amaannawab923 commented on code in PR #33357:
URL: https://github.com/apache/superset/pull/33357#discussion_r2081815332


##########
superset-frontend/plugins/plugin-chart-table/src/DataTable/components/GlobalFilter.tsx:
##########
@@ -66,17 +92,37 @@ export default (memo as <T>(fn: T) => T)(function 
GlobalFilter<
     200,
   );
 
+  // Preserve focus during server-side filtering to maintain a better user 
experience
+  useEffect(() => {
+    if (
+      serverPagination &&
+      isSearchFocused.get(id) &&
+      document.activeElement !== inputRef.current
+    ) {
+      inputRef.current?.focus();
+    }
+  }, [value, serverPagination]);

Review Comment:
   There was a problem that i faced with losing the focus in the search field 
... as the user types in search field it triggers a complete re render & the 
search field focus is lost... Hence we are preserving the focus with the help 
of a map 



-- 
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: notifications-unsubscr...@superset.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to