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

Prevent clipping input text in Chrome + Segoe UI Font #14179

Merged

Conversation

kdumontnu
Copy link
Contributor

@kdumontnu kdumontnu commented Dec 29, 2020

Closes #14162

Before

image

After

image

The overall element height stays the same.

There is an issue in Chrome + Windows where the line-height is cropped too short. It seems like at least partially an issue with how Chrome calculates the height, but this fix should be more stable for different user fonts.

Note: I changed only the clone panel css classes. The other input elements remain as they were, as they didn't have the same issue with cropping the text.

@techknowlogick techknowlogick added this to the 1.14.0 milestone Dec 29, 2020
@techknowlogick techknowlogick added type/bug topic/ui Change the appearance of the Gitea UI labels Dec 29, 2020
@silverwind
Copy link
Member

Can't reproduce on macOS but I wonder what's causing the clipping in first place. Normally, such clipping is caused by overflow: hidden but it's not set and even if I set a lower line-height like .5em, it would never clip because padding essentially counter-acts it. I must be missing something.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Dec 29, 2020
@kdumontnu
Copy link
Contributor Author

Can't reproduce on macOS

Perhaps if you use Segoe UI font (which is what I get with system-ui on Windows).

even if I set a lower line-height like .5em, it would never clip because padding essentially counter-acts it.

Hmm, appears your right. I assumed that since left/right padding clip text that the bottom padding would clip as well. However, when I set height: 28px the bottom padding doesn't clip the text. Only the low line-height clips the text (in Chrome).

image

I'll update the Chrome bug.

I'm okay if you want to close this and just wait for a fix to come in Chrome. I'll probably merge the change in my fork.

@zeripath
Copy link
Contributor

zeripath commented Dec 29, 2020

@silverwind I've seen clipping like this too. - but it might have been on segoe ui too

@zeripath
Copy link
Contributor

zeripath commented Dec 29, 2020

clipping

https://try.gitea.io/arandomer/merge-test

with noto sans

@zeripath
Copy link
Contributor

this pr does fix that issue

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Dec 29, 2020
@codecov-io
Copy link

codecov-io commented Dec 31, 2020

Codecov Report

Merging #14179 (5fed2c3) into master (21adeaa) will decrease coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #14179      +/-   ##
==========================================
- Coverage   42.02%   42.00%   -0.03%     
==========================================
  Files         734      734              
  Lines       78780    78780              
==========================================
- Hits        33106    33088      -18     
- Misses      40239    40251      +12     
- Partials     5435     5441       +6     
Impacted Files Coverage Δ
modules/indexer/stats/db.go 40.00% <0.00%> (-20.00%) ⬇️
modules/indexer/stats/queue.go 64.70% <0.00%> (-11.77%) ⬇️
modules/process/manager.go 72.50% <0.00%> (-2.50%) ⬇️
modules/git/repo_commit_nogogit.go 63.33% <0.00%> (-1.67%) ⬇️
models/gpg_key.go 53.33% <0.00%> (-0.58%) ⬇️
services/pull/pull.go 42.35% <0.00%> (-0.51%) ⬇️
models/error.go 38.49% <0.00%> (-0.49%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 21adeaa...5fed2c3. Read the comment docs.

Copy link
Member

@lafriks lafriks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update with base branch

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jan 1, 2021
@techknowlogick techknowlogick merged commit 0f99edf into go-gitea:master Jan 1, 2021
@go-gitea go-gitea locked and limited conversation to collaborators Feb 11, 2021
@kdumontnu kdumontnu deleted the kd/prevent_input_clipping branch February 16, 2021 22:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. topic/ui Change the appearance of the Gitea UI type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bottom text truncated on input text
7 participants