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

Wrappin the search results in a scrollable container #946

Closed
cemremengu opened this issue Nov 28, 2016 · 6 comments
Closed

Wrappin the search results in a scrollable container #946

cemremengu opened this issue Nov 28, 2016 · 6 comments

Comments

@cemremengu
Copy link

Currently when there is a lot of search results, the content goes down infinitely. Is there a way to restrict the size of results container and make it scrollable instead ?

search

@jeffcarbs
Copy link
Member

Semantic-UI-React only concerns itself with React components that generate valid Semantic-UI markup. There is no HTML nor CSS code in this project.

Semantic-UI core (https://github.com/Semantic-Org/Semantic-UI) does not provide styling for scrollable search results, so you'll have to raise an issue with them. For what it's worth, looks like this issue was already raised (Semantic-Org/Semantic-UI#3389) and closed but you can certainly try again.

@themre
Copy link

themre commented Mar 7, 2017

don't know how much is this used but getting 40 items stretch over the viewport seems not very nice. we could add maxResultsHeight prop to add max-height CSS property on result holder and also add overflow: auto so remove this kind of behaviour. it seems that wrapper was provided but you need to always add this hack into your css.

@levithomason
Copy link
Member

I'll try to shed some light on why we don't include any styles this library.

Semantic UI is the most themeable CSS framework there is. The proper solution here is to customize your theme variables to handle this, or, even add an override style to your theme. This way, the styles are context aware of the rest of your theme.

We don't add styles in top of the theme for several reasons. One, we wouldn't know what values would work for all themes. There are dependencies in the LESS that when it is compiled down to CSS. Another reason is that online styles override stylesheet rules, so, if a user loaded a theme with a particular style, our components should respect those and not override them. Yet another is that it adds unnecessary weight, the themes are already completely customizable so the changes should happen there.

All said, we have theming in mind for this library as well. Feedback encouraged #1009

@vmundhra
Copy link

.search .results {
overflow-y: auto;
max-height: 300px;
}

@tom-wagner
Copy link

tom-wagner commented Mar 4, 2019

To piggy back on @vmundhra's comment, as of Semantic UI React version 0.78.1 I used the following:

.ui.search > .results {
  overflow-y: auto;
  max-height: 550px;
}

@rakeshhotker
Copy link

how to save this patch to be able to share it with others

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

No branches or pull requests

7 participants