-
Notifications
You must be signed in to change notification settings - Fork 14
Make this a JavaScript library #2
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
Conversation
|
Hello, @ivteplo , I think you should drop the legendary ultimate DOM selector as it is a costly operation compared to just getElementById. It allows just as much readability but also the highest performance which is essential for a smooth ux. |
|
Maybe this will be useful to someone who is also interested in how to 'trap focus' inside of a modal: |
Now API is more universal. The sheet body won't be automatically replaced with the component code. Instead, the library user should do it personally. `aria-controls` was set to `""` in HTML. The test has been updated according to the API changes. Additionally, `<template>` is now used to store sheet body (so that it won't be shown to the user in case the page will be loading for a long time)
|
As far as I can see, focus trapping is quite a problematic feature. Probably, it would be better to let the user implement it instead (e.g. using a special library). Why I consider this feature problematic to implement here:
I might create a tutorial on how to trap the focus inside the sheet with a separately-installed focus-trapping library (or libraries). |
Fixes #3: the height of the sheet won't change anymore. Instead, the `translateY` and `scale` get changed.
Thus the user can rename the component and will not have to solve conflicts with other components
Related issue: #1
Things to do:
BottomSheetclassaria-controlsproperty for a button that closes a sheetaria-controlsproperty for a button that opens the sheet (just to make the example code better)windowobjectAdd the title area in the top bar of the sheet- This can be a future enhancement