Skip to content

Fix width change causing overflow #58

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

Merged
merged 1 commit into from
Mar 4, 2025

Conversation

ZachHaber
Copy link
Contributor

πŸ”— Linked issue

#11

❓ Type of change

  • 🧹 Updates to the build process or auxiliary tools and libraries
  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸš€ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Resolves #11 (which while closed, I can also confirm that the issue still occurs in chrome. It doesn't appear to occur in firefox, and I don't have the ability to check safari)

It looks like the sub-pixel values coming back from the window.getComputedStyle api is slightly lower than what it needs to be for preventing overflows which causes the icon to be moved underneath the body.
{7B61ACD0-991C-44DD-9B12-D5BB3B8F7063}

The way I resolved it is by adding 0.01 to the width which is enough to counteract that in all cases I've tested so far. The other option would be to just use el.clientWidth which returns a rounded int value already, though there might be slight twitches in the width depending on how much the width changes from that.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@nandi95 nandi95 merged commit eea9156 into nandi95:master Mar 4, 2025
4 checks passed
@ZachHaber ZachHaber deleted the toast-overflow-issue branch March 4, 2025 17:30
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.

Rectangle unwanted resizing
2 participants