Skip to content

fix: use padding instead of margin to avoid overflow - #8873

Merged
vursen merged 2 commits into
mainfrom
change-margin-to-padding
Mar 31, 2025
Merged

vursen merged 2 commits into
mainfrom
change-margin-to-padding

Conversation

@vursen

@vursen vursen commented Mar 28, 2025 •

Copy link
Copy Markdown
Contributor

Description

The calc(var(--lumo-border-radius-m) / 4) calculation can produce a fractional value, which causes an overflow when used as the value of margin-left:

Screen.Recording.2025-03-28.at.14.35.16.mov

The PR replaces margin-left with padding-left, which prevents the overflow.

Type of change

  • Bugfix

@vursen
vursen requested review from jouni and removed request for jouni March 28, 2025 10:41
@vursen
vursen marked this pull request as ready for review March 28, 2025 10:50
@vursen

vursen commented Mar 28, 2025

Copy link
Copy Markdown
Contributor Author

Test snippet:

<script type="module">
  import '@vaadin/split-layout';
  import '@vaadin/text-field';
</script>

<vaadin-split-layout>
  <vaadin-text-field label="Confirm password"></vaadin-text-field>
  <div></div>
</vaadin-split-layout>

@sonarqubecloud

Copy link
Copy Markdown

@web-padawan web-padawan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just noticed that [part="error-message"] also uses margin-left: calc(var(--lumo-border-radius-m) / 4); - could it cause overflow as well? It probably makes sense to update both for consistency?

@vursen

vursen commented Mar 31, 2025 •

Copy link
Copy Markdown
Contributor Author

Just noticed that [part="error-message"] also uses margin-left: calc(var(--lumo-border-radius-m) / 4); - could it cause overflow as well?

I wasn't able to reproduce the issue with the error message, so I decided to leave it unchanged. The issue is apparently specific to the use of text-overflow: ellipsis.

Screen.Recording.2025-03-31.at.17.00.26.mov

I can update it for consistency – I just was unsure if that would still qualify as a fix.

@web-padawan

Copy link
Copy Markdown
Member

@vursen Thanks, then let's probably keep it unchanged for now if error message doesn't cause problems.

@vursen
vursen merged commit 1083731 into main Mar 31, 2025
@vursen
vursen deleted the change-margin-to-padding branch March 31, 2025 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants