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

fix(NcReferenceWidget): use requestAnimationFrame in observers #5561

Merged
merged 3 commits into from
May 8, 2024

Conversation

max-nextcloud
Copy link
Contributor

@max-nextcloud max-nextcloud commented May 7, 2024

Without requestAnimationFrame resize observer causes cypress to crash.

Also use a ref for the width and a computed for the resulting number of lines.

☑️ Resolves

🖼️ Screenshots

grafik

🏁 Checklist

  • ⛑️ Tests are not applicable
  • 📘 Component documentation is not applicable
  • 3️⃣ Backport to next requested with a Vue 3 upgrade

Without `requestAnimationFrame` resize observer causes cypress to crash.

Also use a ref for the width and a computed for the resulting number of lines.

Signed-off-by: Max <[email protected]>
@max-nextcloud max-nextcloud force-pushed the fix/request-animation-frame-for-observers branch from f795563 to 440b5a7 Compare May 7, 2024 12:57
@max-nextcloud
Copy link
Contributor Author

Cypress fails like this:

grafik

No idea what is causing this.

src/components/NcRichText/NcReferenceWidget.vue Outdated Show resolved Hide resolved
@juliusknorr juliusknorr added bug Something isn't working 3. to review Waiting for reviews labels May 7, 2024
Seems more light weight and also fixes the cypress tests

Also add comments as to why we are using nextTick
in the resizeObserver.

Signed-off-by: Max <[email protected]>
@max-nextcloud max-nextcloud force-pushed the fix/request-animation-frame-for-observers branch from 9738fe4 to 112eee7 Compare May 8, 2024 05:52
@max-nextcloud max-nextcloud merged commit 425848e into master May 8, 2024
18 checks passed
@max-nextcloud max-nextcloud deleted the fix/request-animation-frame-for-observers branch May 8, 2024 05:56
@susnux
Copy link
Contributor

susnux commented May 8, 2024

/backport to next

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants