Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hint - fix target frame update #1478

Merged
merged 2 commits into from
Aug 22, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/components/hint/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ export interface HintProps {
* Callback for Hint press
*/
onPress?: () => void;
/**
* Callback for the background press
*/
/**
* Callback for the background press
*/
onBackgroundPress?: (event: GestureResponderEvent) => void;
/**
* The hint container width
Expand Down Expand Up @@ -217,8 +217,8 @@ class Hint extends Component<HintProps, HintState> {
if (!_.isEqual(this.state.targetLayout, layout)) {
this.setState({targetLayout: layout});
}

if (!this.state.targetLayoutInWindow) {
if (!this.state.targetLayoutInWindow || this.props.onBackgroundPress) {
setTimeout(() => {
this.targetRef?.measureInWindow((x: number, y: number, width: number, height: number) => {
const targetLayoutInWindow = {x, y, width, height};
Expand Down