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

Searching in the FlatTermSelector can cause the editor to crash #30932

Closed
lakrisgubben opened this issue Apr 17, 2021 · 2 comments · Fixed by #33419
Closed

Searching in the FlatTermSelector can cause the editor to crash #30932

lakrisgubben opened this issue Apr 17, 2021 · 2 comments · Fixed by #33419
Assignees
Labels
General Interface Parts of the UI which don't fall neatly under other labels. [Priority] High Used to indicate top priority items that need quick attention [Status] In Progress Tracking issues with work in progress [Type] Regression Related to a regression in the latest release

Comments

@lakrisgubben
Copy link

Description

A specific type of search in the FlatTermSelector component can cause the block editor to crash with the JS-error TypeError: undefined is not an object (evaluating 'elem.ownerDocument'). It happens if you have selected a term from the dropdown list with the keyboard after searching and then type a letter in the search box which is not the next letter in the selected term.

The issue exists in both latest WP and GB.

Step-by-step reproduction instructions

  1. Create a tag called "Test" (it can be called anything)
  2. Go to the block editor.
  3. Type "tes" in the tag meta box.
  4. Press down on the keyboard to "select" the tag named test
  5. Continue to type, but type another letter than "t" (i.e. any letter which is not the next letter in the tag name).
  6. This'll cause the editor to crash with the JS-error [Error] TypeError: undefined is not an object (evaluating 'elem.ownerDocument') getClientPosition (components.js:13432)

Expected behaviour

The editor should do a new term search, not crash.

Actual behaviour

The editor crashes and is unrecoverable.

Screenshots or screen recording (optional)

flattermselector-crash

WordPress information

  • WordPress version: 5.7.1
  • Gutenberg version: 10.4.1
  • Are all plugins except Gutenberg deactivated? Yes
  • Are you using a default theme (e.g. Twenty Twenty-One)? Yes

Device information

  • Device: Desktop
  • Operating system: Mac OS 11.2
  • Browser: Tested on both Safari 14 and Chrome 90.
@talldan talldan added [Priority] High Used to indicate top priority items that need quick attention [Type] Regression Related to a regression in the latest release General Interface Parts of the UI which don't fall neatly under other labels. labels Apr 20, 2021
@talldan
Copy link
Contributor

talldan commented Apr 20, 2021

Thanks for reporting this, I tested to confirm the issue.

@Mamaduka
Copy link
Member

It looks like the error is triggered by the dom-scroll-into-view package, which is used by SuggestionsList.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
General Interface Parts of the UI which don't fall neatly under other labels. [Priority] High Used to indicate top priority items that need quick attention [Status] In Progress Tracking issues with work in progress [Type] Regression Related to a regression in the latest release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants