-
Notifications
You must be signed in to change notification settings - Fork 91
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 KSelect dropdown to the Overlay layer #877
Add KSelect dropdown to the Overlay layer #877
Conversation
32372ff
to
67c12c1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for finding a solution to this problem! The code looks good and works correctly in most cases, except on the MyDownloads.vue
page. The two dropdown menus aren't showing up, and there's an error message in the console related to the k-overlay
element.
Since there are only issues with these two, I'm not entirely sure if changes need to be made in Kolibri or KDS to fix it. I just wanted to mention it in case the problem can be solved in KDS, and if not, it might be considered a breaking change.
Just a quick note: since KModal
no longer checks for KSelect
, I believe we can remove the comment in lib/KSelect/index.vue
that says, "BELOW: KModal targets KeenUiSelect by using div.ui-select selector" on line 11.
|
||
this.doClose(); | ||
}, | ||
100, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just out of curiosity, but how was the debounce time 100ms determined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A 100ms delay is a common choice as it falls within the threshold of the shortest perceivable application response delay, as noted here. Although it will always depend on the context. If we were debouncing a user keyboard typing action, to lets say, trigger an api request after the user has finished typing we would rather use a >300 ms debounce delay depending on the context https://stackoverflow.com/questions/42361485/how-long-should-you-debounce-text-input.
Thanks @LianaHarris360! Yes, that was a problem because the KSelect's were being mounted before the
Thanks! Just removed it :) |
685444a
to
b5b5f8a
Compare
I have just rebased the branch with the fix @LianaHarris360! Could you take another look? :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes are working as they should and the code logic makes sense, thanks for your work on this! @AlexVelezLl
Description
Finally, a robust solution is proposed to the many known issues with the KSelect dropdown by teleporting KSelect dropdown to the Overlay layer using Popper.
Issue addressed
Addresses #324 and #690.
Before/after screenshots
overflowY: unset
set because the Modal check for KSelectsScreencast showing the behaviour of KSelect in a long modal:
Compartir.pantalla.-.2024-12-26.16_10_21.mp4
Changelog
Description: Teleport KSelect dropdown to the Overlay layer using Popper.
Products impact: bugfix.
**Addresses:**Kmodal should be able to show dropdowns select without making scrollbars appear #324, Investigate KSelect’s dropdown being displayed above the input in some cases even when there is enough space below #690.
Components: KSelect.
Breaking: no
Impacts a11y: no
Guidance: -.
Description: Removes internal KModal calculations to modify its content height if it had a KSelect inside.
Products impact: bugfix.
**Addresses:**Kmodal should be able to show dropdowns select without making scrollbars appear #324.
Components: KModal.
Breaking: no
Impacts a11y: no
Guidance: -.
Steps to test
(optional) Implementation notes
At a high level, how did you implement this?
I have decided to close the dropdown on scroll, just like the KDropdownMenu, to avoid situations like this:
Otherwise we would need to be querying scrollable ancestors elements, and taking into account the height of any absolute/fixed elements like the topbar to automaticlly close the dropdown.
Does this introduce any tech-debt items?
Testing checklist
Reviewer guidance
Comments