EnxDev opened a new pull request, #36380:
URL: https://github.com/apache/superset/pull/36380

   <!---
   Please write the PR title following the conventions at 
https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   ## Dashboard Filter Clear Fix
   **Problem:**
   
    When creating a report in the alerts modal with a multi-tab dashboard, 
selecting a dashboard filter and then clearing it with the `X icon` would not 
make the filter reappear in the available filters dropdown.
   
   **Root Cause:** 
   
   The filter select's `onClear` handler was directly mutating state without 
calling `setState`, so React didn't detect the change. 
   The filter also remained in `nativeFilterData` with empty values, causing 
`filterNativeFilterOptions()` to continue excluding it from the dropdown.
   
   **Fix:**
   
    Properly update state with `setNativeFilterData` and reset `nativeFilterId` 
to null, which allows the filter to reappear in the available options while 
keeping the filter row visible.
   
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   - Before
   <img width="772" height="1091" alt="before-filters" 
src="https://github.com/user-attachments/assets/b812f73a-02af-47fc-9ddb-e1d641cb2ebc";
 />
   
   - After
   <img width="727" height="1057" alt="after-filters" 
src="https://github.com/user-attachments/assets/c6921696-b420-4505-b4ff-0dfe3412685c";
 />
   
   - Before
   
   
https://github.com/user-attachments/assets/55d4d4f6-44de-4093-aaea-f2d513f8065a
   
   - After
   
   
https://github.com/user-attachments/assets/083a939c-6d9b-4ff1-9cbc-340dcb100c00
   
   
   
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   - All tests should pass
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to