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

Change hasItems to look at filteredItems in block editor inserter #21138

Merged

Conversation

StevenDufresne
Copy link
Contributor

@StevenDufresne StevenDufresne commented Mar 25, 2020

Description

This PR removes the use of useMemo on the suggestion list and addresses issue: #21069.

We most likely want to revisit the logic here but for now, this will restore functionality.

How has this been tested?

  1. Using the steps to reproduced contained in the issue linked above.

Types of changes

Removing useMemo on the suggestion list. This will result in a slight degrade in performance for users that have a large number of blocks... Should be negligible.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR.

@StevenDufresne StevenDufresne changed the title Remove useMemo on suggestion list. [WIP] Remove useMemo on suggestion list. Mar 25, 2020
@StevenDufresne
Copy link
Contributor Author

Opened this a bit premature. :)

To do:

  1. Figure out why the test was passing.
  2. Figure out why 2 tests are failing after change.

@StevenDufresne StevenDufresne changed the title [WIP] Remove useMemo on suggestion list. Remove useMemo on suggestion list. Mar 26, 2020
@StevenDufresne StevenDufresne changed the title Remove useMemo on suggestion list. Change hasItems to look at filteredItems in block editor inserter Mar 26, 2020
@StevenDufresne StevenDufresne changed the title Change hasItems to look at filteredItems in block editor inserter Change hasItems to look at filteredItems in block editor inserter Mar 26, 2020
@StevenDufresne
Copy link
Contributor Author

@youknowriad I updated the hasItems check to look at the filteredItems list. These changes work as expected.

Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

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

Thanks. LGTM

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