yury-dymov / react-autocomplete-input

Autocomplete input field for React
https://yury-dymov.github.io/react-autocomplete-input/
MIT License
195 stars 66 forks source link

Using bounding client rect means the input cannot be inside a position-relative parent #2

Closed rhagigi closed 7 years ago

rhagigi commented 7 years ago

https://github.com/yury-dymov/react-autocomplete-input/blob/master/src/AutoCompleteTextField.jsx#L276

This library is using left: boundingClientRect(el).left, which is the offset from the viewport. It should use el.offsetLeft, as what it's positioning is an absolutely positioned element, which means it needs to know the textarea's starting left within the closest relative position parent (or the viewport).

yury-dymov commented 7 years ago

@rhagigi Hmm, thank you for the feedback, will test soon and update if it will work as expected. You can also do PR if you would like to :)

yury-dymov commented 7 years ago

@rhagigi, thank you for the feedback once again.

Closed via https://github.com/yury-dymov/react-autocomplete-input/commit/4e11d679bdb810a41f724cf91279fa4ea240f278

Let me know if I can further improve the package.