Skip to content

Commit 99ab745

Browse files
authored
Hint - fix target frame update (#1478)
* Hit - fix target frame update * Remeasure only when user passes onBackgroundPress
1 parent 077e495 commit 99ab745

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/components/hint/index.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ export interface HintProps {
110110
* Callback for Hint press
111111
*/
112112
onPress?: () => void;
113-
/**
114-
* Callback for the background press
115-
*/
113+
/**
114+
* Callback for the background press
115+
*/
116116
onBackgroundPress?: (event: GestureResponderEvent) => void;
117117
/**
118118
* The hint container width
@@ -217,8 +217,8 @@ class Hint extends Component<HintProps, HintState> {
217217
if (!_.isEqual(this.state.targetLayout, layout)) {
218218
this.setState({targetLayout: layout});
219219
}
220-
221-
if (!this.state.targetLayoutInWindow) {
220+
221+
if (!this.state.targetLayoutInWindow || this.props.onBackgroundPress) {
222222
setTimeout(() => {
223223
this.targetRef?.measureInWindow((x: number, y: number, width: number, height: number) => {
224224
const targetLayoutInWindow = {x, y, width, height};

0 commit comments

Comments
 (0)