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

Fix clicking on "Remove all filters" does not close the filter menu #9415

Merged
merged 4 commits into from
Nov 3, 2023

Conversation

erwanMarmelab
Copy link
Contributor

@erwanMarmelab erwanMarmelab commented Oct 31, 2023

Problem

The "Add Filter" button disappears, since there are no filters, but as soon as you enter a new filter, the "Add Filter" menu immediately appears in the corner of the screen.
image
video

Solution

Set state to close on "Remove all filters" click

TODOs

  • fix bug
  • add a test

Step to reproduce the bug

  1. Open storybook
  2. Choose "Author" filter
  3. Click on "Add filter"
  4. Click on "Remove all filters"
  5. Choose again "Author" filter
  6. The "Add filter" menu appears in the corner of the screen.

Issue

Closes #9412

Sorry, something went wrong.

@erwanMarmelab erwanMarmelab added the WIP Work In Progress label Oct 31, 2023
@erwanMarmelab erwanMarmelab changed the base branch from master to autocompletinput-clear-button-over-bulk-actions-toolbar October 31, 2023 14:39
Base automatically changed from autocompletinput-clear-button-over-bulk-actions-toolbar to master November 2, 2023 07:00
@@ -593,122 +593,3 @@ export const InsideReferenceArrayInputWithCreationSupport = () => (
<Resource name="books" edit={BookEditWithReferenceAndCreationSupport} />
</Admin>
);

const booksDataProvider = fakeRestDataProvider({
Copy link
Member

@fzaninotto fzaninotto Nov 2, 2023

Choose a reason for hiding this comment

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

Isn't this code used for tests on the AutocompleteArrayInput?

Also, linter warnings.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This data was only used for the test I made in this commit, but this test is now in FisterButton.spec.tsx and works with the FisterButton.stories.tsx

@fzaninotto fzaninotto merged commit 8840592 into master Nov 3, 2023
@fzaninotto fzaninotto deleted the fix-auto-open-filter-menu branch November 3, 2023 13:52
@fzaninotto fzaninotto added this to the 4.15.4 milestone Nov 3, 2023
@slax57 slax57 changed the title Fix auto open filter menu Fix clicking on "Remove all filters" does not close the filter menu Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The "Add Filter" menu appears in the corner of the screen after close
2 participants