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

Inserter: Expand matching categories when searching #7065

Merged
merged 1 commit into from May 31, 2018

Conversation

Projects
None yet
2 participants
@mcsf
Contributor

mcsf commented May 31, 2018

Description

Fixes #7046 by expanding accordions containing blocks matching a search term.

How has this been tested?

Per the parent issue:

  1. Click the main Add Block button to invoke the Inserter
  2. Search, for example, for "embed"
  3. Expect to see results akin to:

Screenshots

Types of changes

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
@aduth

This comment has been minimized.

Member

aduth commented May 31, 2018

Fixes #7046 by expanding accordions containing blocks matching a search term.

Based on the implementation, I think it'd be more accurate to say that it expands all accordions when filtering, regardless of whether it contains a block matching the search query?

Edit: Okay, in retrospect I see we already omit accordions if there are no blocks within which match the query, so the original statement is correct.

@aduth

aduth approved these changes May 31, 2018

Looks good 👍

@@ -207,7 +208,7 @@ export class InserterMenu extends Component {
<PanelBody
key={ category.slug }
title={ category.title }
opened={ isPanelOpen( category.slug ) }
opened={ isSearching || isPanelOpen( category.slug ) }

This comment has been minimized.

@aduth

aduth May 31, 2018

Member

I guess we could want this to be considered as part of the implementation of isPanelOpen. Small thing.

This comment has been minimized.

@mcsf

mcsf May 31, 2018

Contributor

Since isPanelOpen is used elsewhere, it seemed a bit cleaner to keep it separate.

@mcsf mcsf merged commit 7da2101 into master May 31, 2018

2 checks passed

codecov/project 46.47% (+<.01%) compared to 6728906
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@mcsf mcsf deleted the fix/inserter-search-expand branch May 31, 2018

@aduth

This comment has been minimized.

Member

aduth commented Jun 11, 2018

Observed odd behavior noted in Slack today: The accordions are still shown as collapsible controls, but do not do anything when a search is made and the user interacts with the collapse panels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment