endimonan commented on code in PR #43756:
URL: https://github.com/apache/superset/pull/43756#discussion_r3912415560
##########
superset-frontend/plugins/plugin-chart-table/src/DataTable/components/GlobalFilter.tsx:
##########
@@ -116,6 +128,16 @@ export default (memo as <T>(fn: T) => T)(function
GlobalFilter<
const handleBlur = () => {
isSearchFocused.set(id, false);
+ isComposingRef.current = false;
Review Comment:
I checked this in the running app with Chromium, driving a real composition
through CDP. Blurring mid composition (clicking elsewhere or a programmatic
blur) commits it: compositionend fires before blur and the text stays in the
input. So by the time handleBlur runs the flag is already cleared and
compositionend has re-queued the committed value, and after both debounces
exactly one /chart/data request went out with that value, which is what the
input shows.
Cancelling the pending update on blur would drop that, and it would also
change the non IME path, where typing and blurring within 200ms produces one
search today, same as on master. Cancelling only while the flag is still set
would be a no-op in Chromium and, in a browser that blurs without
compositionend, would leave text in the box that the table doesn't reflect.
I added a test that blurs right after a provisional change and asserts a
single search with the value left in the input. @sadpandajoe
--
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]