Skip to content

Bug: Availability component loading bar is out of place #295

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
Dec 23, 2021

Conversation

yifanplanet
Copy link
Contributor

@yifanplanet yifanplanet commented Dec 22, 2021

Code changes

  • Set days container to position relative default

Screenshots

Before

Screen Shot 2021-12-22 at 5 57 45 PM

After

Screen Shot 2021-12-22 at 5 57 25 PM

Readiness checklist

  • Included before/after screenshots, if the change is visual

Explanations

TLDR:

Make sure to manually set the position CSS property other than initial on the element with bind:clientWidth, clientHeight, offsetWidth and offsetHeight. Otherwise it might get added with an inline position: relative during compile, which could break the layout unexpectedly.

This is more complicated than I expected. This progress bar's visual went out of place for several times in our PR history.

By comparing the different versions above you can see on #222 and #242, the <div class="days schedule"> has an inline style position: relative added.

This is caused by the bind:clientWidth binding we have on this element, which adds this inline position: relative during compile and breaks the layout.
It seems like an unsolved issue of Svelte in Firefox, but it somehow happens in Chrome as well in my testing (which will be triggered by accessing props of the _this.calendars before mount).

References

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

@shortcut-integration
Copy link

This pull request has been linked to Shortcut Story #76439: Bug: Availability component loading bar is out of place.

@vercel
Copy link

vercel bot commented Dec 22, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/nylas/components/HWGvQvvNn77uXSPGNWsEvh83SCwE
✅ Preview: https://components-git-yifan-sc-76439availability-loadingbar-fix-nylas.vercel.app

@yifanplanet yifanplanet merged commit 516e093 into main Dec 23, 2021
@yifanplanet yifanplanet deleted the yifan/sc-76439/availability-loadingbar-fix branch December 23, 2021 18:33
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.

2 participants