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

compose: Fix compose-preview size in expanded mode. #19321

Merged
merged 1 commit into from
Jul 22, 2021

Conversation

garg3133
Copy link
Member

@garg3133 garg3133 commented Jul 19, 2021

The CSS properties used to make the #compose-textarea full-size
were missing for the #preview_message_area, thus, it was just
getting to the height as specified in the max-height property
of #preview_compose_box.

Adding the missing CSS properties resolved the problem, but only
for not-too-long messages. For very-long messages, the preview
message area was overflowing the parent container (attaining the
maximum height possible according to the content, due to the absence
of max-height), which led to the controls below compose-box to
disappear.

Adding an additional property of height: 1.5em solved this problem,
as if a height lower than min-height is set to an element, it attains
its min-height.

Tested manually on my Ubuntu Development environment.

Fixes: #19243.

GIFs or screenshots:

Without height property
Screenshot from 2021-07-20 01-01-27

With height property
Screenshot from 2021-07-20 01-02-32

The CSS properties used to make the `#compose-textarea` full-size
were missing for the `#preview_message_area`, thus, it was just
getting to the height as specified in the `max-height` property
of `#preview_compose_box`.

Adding the missing CSS properties resolved the problem, but only
for not-too-long messages. For very-long messages, the preview
message area was overflowing the parent container (attaining the
maximum height possible according to the content, due to the absence
of max-height), which led to the controls below compose-box to
disappear.

Adding an additional property of `height: 1.5em` solved this problem,
as if a height lower than min-height is set to an element, it attains
its min-height.

Tested manually on my Ubuntu Development environment.

Fixes: zulip#19243.
@zulipbot
Copy link
Member

Hello @zulip/server-compose members, this pull request was labeled with the "area: compose" label, so you may want to check it out!

@garg3133
Copy link
Member Author

garg3133 commented Jul 19, 2021

I tried a lot to find a way to do this without adding an extra height property but couldn't find any. @Signior-X can you please take a look at this and suggest if you have any better way of preventing #preview_message_area from overflowing?

@timabbott timabbott requested a review from Signior-X July 20, 2021 00:00
@timabbott
Copy link
Sponsor Member

timabbott commented Jul 20, 2021

This looks reasonable to me, but I'll hold off on merging until @Signior-X can take a look at it, in case he has better ideas or additional context that can help.

@Signior-X
Copy link
Member

I tried a lot to find a way to do this without adding an extra height property but couldn't find any. @Signior-X can you please take a look at this and suggest if you have any better way of preventing #preview_message_area from overflowing?

So, I also tried it. But I think that the simplebar is handling the scroll here and I tried seeing any other way. I feel this solution is the best one.

Also, I tried just removing display: none from the #compose_textarea and see this screenshot, how perfectly this flexbox is working. Now, the flex:1 is working perfectly with this height:1.5em.
image

With max-height: none, this is similar to the #compose_textarea and these both are the child of .messagebox.
So, good to merge.

@timabbott timabbott merged commit 9fe6194 into zulip:master Jul 22, 2021
@timabbott
Copy link
Sponsor Member

Merged, thanks folks!

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

Successfully merging this pull request may close these issues.

compose: Fix extra whitespace area under the compose box in the preview mode.
4 participants