fix bug: when height of dropdown list is auto#132
fix bug: when height of dropdown list is auto#132dinhtho wants to merge 4 commits intosohobloo:masterfrom dinhtho:dinhtho
Conversation
components/ModalDropdown.js
Outdated
|
|
||
| const dropdownHeight = (this.props.dropdownStyle && StyleSheet.flatten(this.props.dropdownStyle).height) || | ||
| StyleSheet.flatten(styles.dropdown).height; | ||
| const dropdownHeight = (this.props.dropdownStyle && StyleSheet.flatten(this.props.dropdownStyle).height); |
There was a problem hiding this comment.
Shouldn't you change const to let? You changed the dropdownHeight in the following lines.
|
@dinhtho Does it work on your side? I just tried your code, still not working as expected. - the dropdown menu not showing under status bar, but stretch quite tall. :( |
|
Sorry @maxhis , that is a my mistake when I edit my code, you can see my code updated and now it works perfectly |
|
Thanks @dinhtho . But unfortunately, still not working on my side. |
|
|
Tried it on both iOS and Android - still not working. :( |
|
please comment your code here |
|
Here is the code snippet. BTW, I'm using |
|
@maxhis Your problem is here |
|
@dinhtho Actually, I modified the |
| StyleSheet.flatten(styles.dropdown).height; | ||
| if (dropdownHeight == "auto") { | ||
| let itemHeight = (this.props.style && StyleSheet.flatten(this.props.style).height); | ||
| dropdownHeight = itemHeight * this.props.options.length; |
There was a problem hiding this comment.
possibly missing separator height in this way.
StyleSheet.flatten(this.props.style).height seems not the item height.
|
I think we should only think about |
|
@maxhis yes, I found my issue in my code when get
|
|
If you want to height of dropdown list as a auto height, you need set value for height of item on dropdown list, |
fix issue: #130
set height for dropdown list if dropdownStyle has height is auto.
New height based on height of dropdown button and quanlity of options in dropdown list.