Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3502728
D13069.id43364.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D13069.id43364.diff
View Options
diff --git a/native/tooltip/nux-tips-overlay.react.js b/native/tooltip/nux-tips-overlay.react.js
--- a/native/tooltip/nux-tips-overlay.react.js
+++ b/native/tooltip/nux-tips-overlay.react.js
@@ -194,44 +194,56 @@
[position],
);
- const tipContainerStyle = React.useMemo(() => {
- const { x, y, width, height } = initialCoordinates;
-
- const style: WritableAnimatedStyleObj = {};
- style.position = 'absolute';
- style.alignItems = 'center';
- style.opacity = tipContainerOpacity;
-
- const transform: Array<ReanimatedTransform> = [];
+ const baseTipContainerStyle = React.useMemo(() => {
+ const { y, x, height, width } = initialCoordinates;
- transform.push({ translateX: tipHorizontal });
+ const top =
+ Math.min(y + height, verticalBounds.y + verticalBounds.height) + margin;
const extraLeftSpace = x;
const extraRightSpace = dimensions.width - width - x;
if (extraLeftSpace < extraRightSpace) {
- style.left = 0;
- style.minWidth = width + 2 * extraLeftSpace;
+ return {
+ top,
+ position: 'absolute',
+ alignItems: 'center',
+ left: 0,
+ minWidth: width + 2 * extraLeftSpace,
+ };
} else {
- style.right = 0;
- style.minWidth = width + 2 * extraRightSpace;
+ return {
+ top,
+ position: 'absolute',
+ alignItems: 'center',
+ right: 0,
+ minWidth: width + 2 * extraRightSpace,
+ };
}
+ }, [
+ dimensions.width,
+ initialCoordinates,
+ verticalBounds.height,
+ verticalBounds.y,
+ ]);
- style.top =
- Math.min(y + height, verticalBounds.y + verticalBounds.height) + margin;
+ const tipContainerStyle = React.useMemo(() => {
+ const style: WritableAnimatedStyleObj = {};
+ style.opacity = tipContainerOpacity;
+
+ const transform: Array<ReanimatedTransform> = [];
+
+ transform.push({ translateX: tipHorizontal });
transform.push({ translateY: tipVerticalBelow });
transform.push({ scale: tipScale });
style.transform = transform;
- return style;
+ return { ...baseTipContainerStyle, ...style };
}, [
- dimensions.width,
- initialCoordinates,
+ baseTipContainerStyle,
tipContainerOpacity,
tipHorizontal,
tipScale,
tipVerticalBelow,
- verticalBounds.height,
- verticalBounds.y,
]);
const triangleStyle = React.useMemo(() => {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 21, 5:00 AM (18 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2685974
Default Alt Text
D13069.id43364.diff (2 KB)
Attached To
Mode
D13069: [native] Extract normal style from animated style
Attached
Detach File
Event Timeline
Log In to Comment