-
-
Notifications
You must be signed in to change notification settings - Fork 335
[Enhancement]: [Search] Scrollable search result #1350
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
1. Handles keyboard events 2. Regains scroll position after closing of results due to blur/select event
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 for this PR.
You need to mention that this is only working when the .results
class has an overflow and fixed height set.
So i suggest you also implement additional classes similiar to the ones we have for dropdown already,so your change is actually of any use (out of the box)
.ui.scrolling.search > .results
.ui.short.scrolling.search > .results
.ui.very.short.scrolling.search > .results
.ui.long.scrolling.search > .results
.ui.very.long.scrolling.search > .results
Please make sure the height settings are defined as variables and support responsive widths via media queries just like we have for dropdown
Fomantic-UI/src/definitions/modules/dropdown.less
Lines 461 to 471 in 62bd670
& when (@variationDropdownLong) { | |
.ui.selection.dropdown.long .menu { | |
max-height: @selectionMobileMaxMenuHeight * 2; | |
} | |
.ui.selection.dropdown[class*="very long"] .menu { | |
max-height: @selectionMobileMaxMenuHeight * 3; | |
} | |
} | |
} | |
@media only screen and (min-width: @tabletBreakpoint) { | |
& when (@variationDropdownShort) { |
When done it would be very nice if you could also create a PR for a proper docs example 😉
Examples
Current behavior
- search result is limited and does not scroll
http://jsfiddle.net/gtk760c3
Applied your PR
- No difference, still not scrolling
http://jsfiddle.net/gtk760c3/1/
Adjusted CSS
- Now your fix makes sense as the results div has a fixed height and an overflow-y set
http://jsfiddle.net/gtk760c3/2/
I tested this PR in http://jsfiddle.net/gtk760c3/2/ added by @lubber-de . |
1. Handles keyboard events 2. Regains scroll position after closing of results due to blur/select event 3. Variation classes added such as scrolling, short, long, very short and very long
@lubber-de Scrolling and height variations added to results :) |
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.
LGTM
I prepared a testcase where the additional classes are implemented here
http://jsfiddle.net/yj4nhqkc/
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.
LGTM 🥇
@patilkiranm Please see my comment from the docs PR fomantic/Fomantic-UI-Docs#199 (review), because the scrolling only has effect on mobile/small devices (or if the |
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.
LGTM
@all-contributors please add @patilkiranm for code and doc |
I've put up a pull request to add @patilkiranm! 🎉 |
Description
Now it is possible to make search results scroll-able.
Screenshot
Search: Without category

Search: Withcategory

Closes
Semantic-Org/Semantic-UI#6488 via new
long
andshort classes