trendmicro-frontend / tonic-ui

Tonic UI is a UI component library for React, built with Emotion and Styled System. It is designed to be easy to use and easy to customize.
https://trendmicro-frontend.github.io/tonic-ui
MIT License
125 stars 28 forks source link

Migrate from Popper v2 to Floating UI #895

Open cheton opened 1 month ago

cheton commented 1 month ago

Learn how to migrate from Popper v2 to Floating UI: https://floating-ui.com/docs/migration

Popper v2 https://popper.js.org/docs/v2/

Floating UI https://floating-ui.com/

cheton commented 1 month ago

This enhancement will make the tooltip positioning dynamic based on overflow state:

+  const more = {
+    disabled: !isOverflow,
+  };
+  if (isOverflow) {
+    more.nextToCursor = true;
+  }
+
   return (
     <Tooltip
       ref={ref}
       arrow={false}
       disabled={!isOverflow}
-      nextToCursor={true}
+      {...more}
       {...rest}
     >