-
-
Notifications
You must be signed in to change notification settings - Fork 656
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
Fix and improve autocomplete popup size #2919
Conversation
c41e1ac
to
3d537c4
Compare
Fixes zulip#2917 Several previous changes regressed the styling of the Popup. The ideal size of the popup can be described as: 'the whole screen sans the keyboard and with some padding around'. The lack of CSS `position` prop value of `fixed` being supported, and the lack of React portals (another option) support makes implementing this tricky and requires a lot of rework. This commit finds a good middle ground - use a max height of half the screen height minus the compose box's height.
Make the layout styling of Popup component more consistently: * layout using material design padding/margin values * 'bottom' styling is not needed * 'shadowOpacity' and 'shadowRadius' to distinguish the popup better from the background
3d537c4
to
c58e689
Compare
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.
return ( | ||
<View style={[styles.wrapper, { marginBottom }]}> | ||
<View style={[styles.wrapper, { height: height / 2 - marginBottom, marginBottom }]}> |
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.
(Before we had it as 1/4 of height, to tackle landscape scenario too b4cd7c8)
Ah, playing with the Pulling it up to be a sibling will require some tricky rewiring of how the autocomplete communicates with the input fields, as it'll be one layer farther away. I think that's totally doable, but it'll be less work if we wait to do it until we've de-duplicated ComposeBox again -- which we had a previous effort at in #2886, but now is probably best done after upgrading to RN v0.57, which in turn will follow #2788 / #2789 upgrading to v0.56. Meanwhile, we should do something to make the autocomplete at least not look broken. How about setting its height to a fixed number of rows -- like 5? That should be an improvement over the status quo. |
@borisyankov and I chatted a bit about this today.
|
Merged that piece as 69ece87. Thanks @borisyankov ! |
Fixes #2917
Makes the sizing of the autocomplete popup more consistent and logical.