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

[select] fix(Omnibar): handle initialContent undefined value correctly #4368

Merged
merged 2 commits into from
Nov 11, 2020

Conversation

DannyDelott
Copy link
Contributor

@DannyDelott DannyDelott commented Oct 14, 2020

Checklist

  • Includes tests

Changes proposed in this pull request:

Fixes a bug where Omnibar is unable to render all items when initialContent is explicitly set to undefined.

Related to #3174

Reviewers should focus on:

The documentation for Omnibar's initialContent states:

If omitted, all items will be rendered (or result of itemListPredicate with empty query).
If explicit null, nothing will be rendered when query is empty.

Under the hood, QueryList is only checking undefined:

if (props.query.length === 0 && initialContent !== undefined) {
return initialContent;
}

It's probably a larger breaking change to remove the default null value, but this at least solves the problem in the near term, ie:

<Omnibar
  // render all the items when no query is present
  initialContent={undefined}
  isOpen={...}
  items={[...]}
  itemRenderer={...}
  onItemSelect={...}
  />

@DannyDelott DannyDelott changed the title Fix bug causing Omnibar not to render initialContent prop as described in docs [omnibar] Fix bug causing Omnibar not to render initialContent prop as described in docs Oct 14, 2020
@adidahiya
Copy link
Contributor

docs preview build

Copy link
Contributor

@adidahiya adidahiya left a comment

Choose a reason for hiding this comment

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

thanks @DannyDelott

@adidahiya adidahiya changed the title [omnibar] Fix bug causing Omnibar not to render initialContent prop as described in docs [select] fix(Omnibar): handle initialContent undefined value correctly Nov 11, 2020
@adidahiya adidahiya merged commit 5d974da into palantir:develop Nov 11, 2020
ejose19 pushed a commit to ejose19/blueprint that referenced this pull request Nov 11, 2020
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