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

   ### SUMMARY
   When typing with an IME (Chinese Pinyin, Japanese, Korean), the Table chart 
search box fires the search while the composition is still in progress. Pausing 
for more than 200ms while picking a candidate is enough, so with server-side 
pagination the backend gets queried with unfinished phonetic text like "nihao" 
and the table filters on text the user never meant to search.
   
   The fix keeps the input display updating during composition but holds the 
search trigger until compositionend. A ref tracks the composition state and the 
debounced callback in GlobalFilter skips firing while it is set; compositionend 
re-triggers with the final text, which also covers the case where the debounce 
already fired mid-composition. The composition handlers are threaded through 
SearchInputProps so the custom SearchInput in TableChart.tsx (the one actually 
rendered) receives them too.
   
   The AG Grid table has the same problem, as the reporter noted in the issue 
comments. I kept this PR scoped to the Table chart and can follow up on the AG 
Grid side separately.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   Before: typing with a Pinyin IME and pausing mid-composition triggers a 
search for the raw phonetic text (see the screenshot in #43714).
   After: the search only fires once the candidate is selected.
   
   ### TESTING INSTRUCTIONS
   1. Create a Table chart with server-side pagination and the search box 
enabled, and open it in a dashboard.
   2. Type in the search box using a CJK IME and pause for more than 200ms 
before picking a candidate.
   3. The table should only filter after the composition is committed.
   
   The new unit test covers the same flow: compositionstart, type "nihao", 
advance past both debounces (200ms input, 800ms search) asserting the 
provisional text stays visible and nothing was searched, then commit "你好" via 
compositionend and assert exactly one search with the final text.
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [x] Has associated issue: Closes #43714
   - [ ] 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