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

Reduce duplicated utilities #12

Closed
sadeghbarati opened this issue Jan 10, 2024 · 4 comments
Closed

Reduce duplicated utilities #12

sadeghbarati opened this issue Jan 10, 2024 · 4 comments
Labels

Comments

@sadeghbarati
Copy link
Collaborator

Thanks for take care of porting vaul to Vue


radix-vue uses @vueuse/core underhood so why not use their utility functions?

why not using our local utility functions?

They have same logic why not replace them with already defined utility in @vueuse/core? we can prevent duplication by doing this

Local utils @vueuse/core utils
isIOS function isIOS expression
addEvent useEventListener
set function CSS maybe useCssVar I'm not sure about this one

Or other local utility which I can't recognize the equivalent in @vueuse/core

@Elliot-Alexander
Copy link
Collaborator

Yeah I think this a great idea, cleans up quite a few utility functions :D

@Elliot-Alexander
Copy link
Collaborator

Going through this, I have a suspicion that we can remove a lot of the util if we use the useScrollLock as it appears to resolve most of what those utils work to achieve. @connerblanton what are your thoughts? I raised #21 which includes this change and tested on old iPhone 8 I have (couldn't see any issues but that phone is relatively old)

@connerblanton
Copy link
Collaborator

I think we can definitely do this. However, I do see a problem (I don't think it's caused by this, rather we just have some more work to do for it) when there are inputs and scrollable content. I took the code from the Scrollable with inputs example from Vaul. When I test this example on ours, we automatically focus on the first input and when the keyboard is up, I am able to scroll and the page refreshes (on Safari) when I pull down.

Again, I think we can still use this, but we also need to make this example work

@Elliot-Alexander
Copy link
Collaborator

Ah I see, so this is limited to when the drawer is scrollable and contains input field(s)? You're right then, we'll definitely have to do some work on this

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

No branches or pull requests

3 participants