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 slider error on Block creation #1823

Merged
merged 4 commits into from
Aug 31, 2023
Merged

Conversation

Soare-Robert-Daniel
Copy link
Contributor

@Soare-Robert-Daniel Soare-Robert-Daniel commented Aug 22, 2023

Closes #1710

Summary

  • Tweaked the hook that re-initializes the Glide instance when the num of images changes.
  • Used a React Ref for getting the container for the Glide instance instead of making use of querySelector. This is working nicely in FSE and Widgets. But I still need the querySelector to check if the root is reachable by Glide -- e.g.: Inserter Block Review is not reachable.
  • Solved another error related to the observer when deleting the block.

Screenshots

2023-08-21.17-40-43.mp4

Test instructions

  1. Create a new Slider Block.
  2. Add some images.
  3. The arrows that change the image position should work.

Checklist before the final review

  • Included E2E or unit tests for the changes in this PR.
  • Visual elements are not affected by independent changes.
  • It is at least compatible with the minimum WordPress version.
  • It loads additional script in frontend only if it is required.
  • Does not impact the Core Web Vitals.
  • In case of deprecation, old blocks are safely migrated.
  • It is usable in Widgets and FSE.
  • Copy/Paste is working if the attributes are modified.
  • PR is following the best practices

@Soare-Robert-Daniel Soare-Robert-Daniel added the pr-checklist-skip Allow this Pull Request to skip checklist. label Aug 22, 2023
@Soare-Robert-Daniel Soare-Robert-Daniel self-assigned this Aug 22, 2023
@Soare-Robert-Daniel Soare-Robert-Daniel marked this pull request as ready for review August 22, 2023 07:04
@pirate-bot
Copy link
Contributor

Bundle Size Diff

Package Old Size New Size Diff
Animations 270.78 KB 270.78 KB 0 B (0.00%)
Blocks 1.42 MB 1.42 MB 4 B (0.00%)
CSS 85.28 KB 85.28 KB 0 B (0.00%)
Dashboard 122.49 KB 122.49 KB 0 B (0.00%)
Export Import 83.17 KB 83.17 KB 0 B (0.00%)
Pro 303.27 KB 303.27 KB 0 B (0.00%)

@pirate-bot
Copy link
Contributor

Plugin build for 2ff1ae6 is ready 🛎️!

@Soare-Robert-Daniel Soare-Robert-Daniel changed the title Fix slider error block creation Fix slider error on Block creation Aug 22, 2023
@pirate-bot pirate-bot added the pr-checklist-complete The Pull Request checklist is complete. (automatic label) label Aug 22, 2023
@pirate-bot
Copy link
Contributor

E2E Summary

Typing

Test Average Time (ms) Standard Deviation (ms) Median Time (ms) Quantile for soft limit (%) Quantile for hard limit (%)
Typing 88.99 12.71 86.84 0 (60ms) 21.05 (80ms)
Values above 60ms "0 - 86.84, 1 - 77.92, 2 - 87.18, 3 - 73.29, 4 - 90.76, 5 - 79.99, 6 - 86.64, 7 - 90.57, 8 - 92.19, 9 - 101.75, 10 - 84.65, 11 - 134.33, 12 - 81.77, 13 - 96.72, 14 - 94.85, 15 - 82.27, 16 - 78.58, 17 - 81.83, 18 - 88.59"

Copy link
Member

@HardeepAsrani HardeepAsrani left a comment

Choose a reason for hiding this comment

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

Looks good. During the testing, we can make sure to test it for backward compat & how it works in Widgets area and FSE.

@irinelenache
Copy link
Contributor

@Soare-Robert-Daniel Tested and didn't find any problem 🚀

@HardeepAsrani HardeepAsrani merged commit 997b4f5 into development Aug 31, 2023
32 checks passed
@HardeepAsrani HardeepAsrani deleted the fix/slider-bug branch August 31, 2023 07:23
@pirate-bot
Copy link
Contributor

🎉 This PR is included in version 2.4.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@pirate-bot pirate-bot added the released Indicate that an issue has been resolved and released in a particular version of the product. label Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-checklist-complete The Pull Request checklist is complete. (automatic label) pr-checklist-skip Allow this Pull Request to skip checklist. released Indicate that an issue has been resolved and released in a particular version of the product.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Slider causes console error and navigation don't work in the editor
4 participants