-
Notifications
You must be signed in to change notification settings - Fork 81
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
allow kselect to extend outside of kmodal #429
Merged
rtibbles
merged 10 commits into
learningequality:develop
from
thanksameeelian:kselect-scrollbars-kmodal-cohacking-fork
Apr 15, 2023
Merged
Changes from 6 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c10dd10
update keenuiselect to align more closely with keenui source code to …
thanksameeelian ae3438e
temporary files for ease of testing kselect within a kmodal
thanksameeelian 67b4388
original keenuiselect with overflows removed from kmodal
thanksameeelian afb762d
fixed dropdown getting trapped in modal, modal elongating after closi…
thanksameeelian 427537f
change kselect from needing an insidemodal prop to detecting for itse…
thanksameeelian bef67e9
remove temp testing setup
thanksameeelian 2b8e49d
improve existence checks
thanksameeelian dd0c728
fix formatting problems that occur when multiple kselects are in one …
thanksameeelian 499c7b7
additional code comments after pr feedback
thanksameeelian 75a66c8
trying to appease the linter
thanksameeelian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Could update this check to something like:
to be more precise that this ui-select is inside a modal.
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.
thanks! i'll look into implementing something along these lines tomorrow morning!
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.
@rtibbles i ended up following the spirit of your advice with
querySelectorAll()
after realizing that if there were multipleKSelect
s located within a single modal,this.isInsideModal
would only correctly register astrue
for the firstKSelect
because whenquerySelector
was called by the otherKSelect
s it would grab the firstKSelect
it found and stop looking, so the comparison would fail and the otherKSelect
s would lack their intended styling.unfortunately, while checking the intricacies of these components' behavior when a
KModal
contains 2+KSelect
s I discovered a recurrence some minor undesirable modal-elongating behavior that I already built out conditional code to avoid in the case of there being just 1KSelect
, but accidentally didn't account for how much more complex the relationship between the height properties would become once there were multipleKSelect
s. i've been fiddling around with it frustratingly but haven't yet gotten it working as desired, and am not sure how much brain power is worth dedicating to that case.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.
Hrm - interesting. The additional height only appears when the value is selected in the second one? Or it only happens when a value is selected in both?
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.
only appears once a value is selected in both -- the code i added to try to circumvent this problem is catching it the first time (whichever one is opened first), but because it was hacky it's not catching a second (and subsequent...) ones correctly.
my understanding is that this happens in general because the existing function looks at the scrollHeight of content to determine the height of the modal, and once the dropdown is opened it grabs its length as the newest scrollHeight and makes adjustments. my hack was basically just skipping 1 round of this calculation if a
KSelect
was found in a modal, but a bit more convoluted than that.it would be cool if we could just like...freeze the modal height forever if we knew there were
KSelect
s inside, except a specific dropdown selection, depending on what it was, could result in a change to the rendered content so i figured it needed to remain dynamicThere 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.
so i think maybe the answer is patching up the
updateContentSectionStyle()
calculation in a slightly different way than i have been? (/trying to work on making sure that scrollheight, etc in that function are targeting exactly what we expect and want them to be targeting)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.
[resolved by changing the hacky-ness i was attempting -- originally was skipping a round of calculations if a select exists, now doing a different calculation entirely. gif of updated behavior below, with no more unexpected modal elongation after closing a second
KSelect
in a modal.]