Components: Use Element.scrollIntoView() instead of dom-scroll-into-view#59085
Merged
Components: Use Element.scrollIntoView() instead of dom-scroll-into-view#59085
Element.scrollIntoView() instead of dom-scroll-into-view#59085Conversation
4912120 to
76f86da
Compare
|
Size Change: -4.32 kB (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
76f86da to
6b4a5d5
Compare
aristath
added a commit
that referenced
this pull request
Feb 16, 2024
* trunk: (78 commits) Components: Use `Element.scrollIntoView()` instead of `dom-scroll-into-view` (#59085) DataViews: Correctly display featured image that don't have image sizes (#59111) Elements: Fix block instance element styles for links applying to buttons (#59114) Allow editing of image block alt and title attributes in content only mode (#58998) Add toggle for grid types and stabilise Grid block variation. (#59051) Global Styles: fix console error in block preview (#59112) Navigation: Avoid using embedded records from fallback API (#59076) Refactor responsive logic for grid column spans. (#59057) Editor: Unify Mode Switcher component between post and site editor (#59100) Move StopEditingAsBlocksOnOutsideSelect to Root (#58412) Fix logic error in #58951 (#59101) Block-editor: Auto-register block commands (#59079) Fix small typo in rich text reference guide (#59089) Components: Add lint rules for theme color CSS var usage (#59022) Enter editing mode via Enter or Spacebar (#58795) Updating Storybook to v7.6.15 (latest) (#59074) CustomSelectControl (v1 & v2): Fix errors in unit test setup (#59038) Add stylelint rule to prevent theme CSS vars outside of wp-components (#59020) ColorPicker: Style without accessing InputControl internals (#59069) Pattern block: batch replacing actions (#59075) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
This PR suggests that we utilize the native
Element.scrollIntoView()instead of the external packagedom-scroll-into-view.Why?
All things being equal, using native functionality is always preferred to using external packages and libraries.
But also, the use case for
dom-scroll-into-viewis quite straightforward and goes way back to the initial implementation ofFormTokenFieldin #924 by @youknowriad.From what I understand, there's no good reason to use the external package.
Element.scrollIntoView()has a solid browser support already and works really well in testing.How?
dom-scroll-into-viewsyntax withElement.scrollIntoView()calls in both occurrences:URLInputFormTokenFielddom-scroll-into-viewdependency, along with typings and a related lerna patch.Testing Instructions
Testing Instructions for Keyboard
Use the up and down arrows to navigate the suggestions as shown on the preview.
Screenshots or screencast
URLInput:https://github.com/WordPress/gutenberg/assets/8436925/f941fc4e-43d8-415c-adc6-4fb5dddcfa40
FormTokenField:https://github.com/WordPress/gutenberg/assets/8436925/b88a39a8-b4eb-4525-88c7-5dd5129bd745