bito-code-review[bot] commented on PR #42559:
URL: https://github.com/apache/superset/pull/42559#issuecomment-5114842603

   <!-- Bito Reply -->
   The flagged issue is correct. Returning early when `labelMap[value]` is 
missing prevents the deselection logic from executing, which means existing 
synthetic filters (like 'Other') cannot be cleared by clicking the chart slice.
   
   To resolve this, you should only return early if the value is not currently 
selected. If the value is already selected, it must proceed to the deselection 
logic to allow the filter to be cleared.
   
   ### Proposed Fix
   
   ```typescript
       const selected = Object.values(selectedValues);
       if (!labelMap[value] && !selected.includes(value)) {
         return undefined;
       }
   ```
   
   This change ensures that unknown values are only ignored if they are not 
part of the current selection, allowing selected unknown values to be processed 
for deselection.
   
   **superset-frontend/plugins/plugin-chart-echarts/src/utils/eventHandlers.ts**
   ```
   const selected = Object.values(selectedValues);
       if (!labelMap[value] && !selected.includes(value)) {
         return undefined;
       }
   ```


-- 
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