Comments (5)
+1. And it would be cool to have a sort of "auto" mode which opens the menu in the direction where enough space is available. Having the component near the lower border of the viewport can result in a only partial visible menu.
from react-autocomplete.
+1
from react-autocomplete.
Please!
p.s. is there a way of doing it in jQuery before that happens? help!
from react-autocomplete.
Hi everyone!
You have full control over the menu's styles, so making it render on top instead of at the bottom is as simple as specifying bottom: 0; margin-bottom: -20px;
(replace -20px
with the height of the <input>
element). If you want a more intelligent positioning logic I suggest using a lib/util such as Popper.js. Here's an example of how it could look: https://codesandbox.io/s/kxmmym9mz3 (resize the window vertically to see the menu flip when there's not enough space below, props.open
is used to force the menu to stay open)
There probably won't every be support for this in Autocomplete
, as we don't really want to have responsibility for things such as positioning and style.
Hope this helps!
from react-autocomplete.
Hi @CMTegner I followed your example with Popperjs, everything work fine but the component is not displayed and this also happens in your example if you add <Arrow className="popper__arrow" />
as a child of Popper
component. Any idea?
Mirko
from react-autocomplete.
Related Issues (20)
- iOS Safari: Menu does not open again after selection of an option HOT 1
- Cannot select via click if rendered item is an imported Component. HOT 7
- Sometimes the dropdown does not close
- missing label for input field
- Any way to programatically close the menu /lose focus on the input with the mouse in the menu?
- Render methods should be a pure function of props and state. HOT 2
- Limit items show in the menu HOT 2
- Add throttle to prevent lag
- getItemValue() vs renderItem() HOT 2
- blur() is not triggered when the dropdown is scrolled in phone
- id passed to the inputProps breaks the dropdown
- the AutoComplete was poped out, I can't update the value, and it gives me an error. What a big mess! HOT 2
- how to select the search list item ? HOT 2
- how to create multi level drop down
- how to set required validation to autocomplete when used in form
- Incorrect import in examples
- How to disable options if already selected HOT 2
- changing the font in the input box?
- Give options to replace input with any other element
- Is this repo alive? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-autocomplete.