Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add possibility to disable ScrollView #141

Open
Veryyapeee opened this issue Jul 11, 2024 · 2 comments
Open

Add possibility to disable ScrollView #141

Veryyapeee opened this issue Jul 11, 2024 · 2 comments

Comments

@Veryyapeee
Copy link

Veryyapeee commented Jul 11, 2024

Is your feature request related to a problem? Please describe.
Disabling focus in ScrollView based on flag

Describe the solution you'd like
Easy ability to disable scroll for ScrollView

Additional context
I'm working on component, and I want to hide component with opacity (to keep last focused element), and I'm showing the component on arrow press
The issue is, that in this case the scroll view still scrolls, and I would like to disable scroll for that component
Native scrollView have a prop to disable scroll, but it seems like your library doesn't propagate any props which could solve the issue

Or it would be cool if we could lock the focus in scope of component, so for example some kind of prop to FocusableView/Node which would lock focus in every children, this would help a lot

@pierpo
Copy link
Member

pierpo commented Jul 15, 2024

Hey! I'm not sure I understand your need properly. Why would you hide a focusable component? That means your focus will be lost at some point, right? Since you'll be focusing a hidden element.

Could you do a drawing of what you are achieving?

Besides, I'm not sure locking with disableScroll will work as we do imperative scrolling under the hood. We'll have to try 😁

@Veryyapeee
Copy link
Author

Hey! I'm not sure I understand your need properly. Why would you hide a focusable component? That means your focus will be lost at some point, right? Since you'll be focusing a hidden element.

Could you do a drawing of what you are achieving?

Besides, I'm not sure locking with disableScroll will work as we do imperative scrolling under the hood. We'll have to try 😁

Hi, so I'm developing kinda complicated flow, where I have multiple layers, and it works like that

I'm displaying the layer -> pressing back -> closing layer
And when no layer is active, based on arrow key pressed, different layer is presented
So when I have layer "A" open, then I press back, and then for example arrow right (which again opens layer "A") I want to open layer A again, with focus in the same place
SInce unmounting component is causing focus to get lost (obviously), I'm hiding the layer with plain opacity, but the issue is, that when I press the "arrow right" I just want the layer to show (so disable scroll for that period of time), instead, pressing right scrolls the list, because obviously it's focused and just hidden by opacity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants