You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/08/18 13:01:55 UTC

[GitHub] [superset] villebro commented on a change in pull request #16322: fix(explore): reordering columns with dnd sometimes glitching

villebro commented on a change in pull request #16322:
URL: https://github.com/apache/superset/pull/16322#discussion_r691214366



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/OptionWrapper.tsx
##########
@@ -63,15 +63,11 @@ export default function OptionWrapper(
   const ref = useRef<HTMLDivElement>(null);
   const labelRef = useRef<HTMLDivElement>(null);
 
-  const item: OptionItemInterface = useMemo(
-    () => ({
-      dragIndex: index,
-      type,
-    }),
-    [index, type],
-  );
   const [{ isDragging }, drag] = useDrag({
-    item,
+    item: {
+      type,
+      dragIndex: index,
+    },

Review comment:
       It appears we're a few versions behind `react-dnd` (now on 14; we're on 11). Apparently the deps can now be given as a param after spec:
   
   ![image](https://user-images.githubusercontent.com/33317356/129902439-a5e22a8a-0aa3-4e0c-b9d8-baba38650710.png)
   
   https://react-dnd.github.io/react-dnd/docs/api/use-drag
   
   Might be a good TODO for when we bump this the next time.




-- 
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-unsubscribe@superset.apache.org

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



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