Skip to content

Feat/hint pressable target #1630

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

Merged
merged 9 commits into from
Nov 2, 2021
Merged

Feat/hint pressable target #1630

merged 9 commits into from
Nov 2, 2021

Conversation

ethanshar
Copy link
Collaborator

@ethanshar ethanshar commented Oct 30, 2021

Description

  • Fix issue with target not being pressable while Hint is visible by rendering a mock children (target)
  • Added a new prop backdropColor to allow users to color the background which gives more emphasis on the hinted target
  • I added a new API in ExampleScreenPresenter for rendering options using our SegmentedControl component
  • I refactored the Hint example screen so the configuration options will display on top of a dialog and keep the actual screen cleaner

WOAUILIB-2177

Changelog

  • Hint - Fix issue with target not being pressable while Hint is visible and added backdropColor prop to color overlay background

@lidord-wix
Copy link
Contributor

Few issues before reviewing the code -

  1. When using the targetRef prop with onBackgroundPress prop, the hint is rendered above its target.
  2. When passing onBackgroundPress you still can't press the target button in one press. (both when the target is a child and when using targetRef).
  3. Consider adding an example with onBackgroundPress to the example screen.

@ethanshar
Copy link
Collaborator Author

Few issues before reviewing the code -

  1. When using the targetRef prop with onBackgroundPress prop, the hint is rendered above its target.
  2. When passing onBackgroundPress you still can't press the target button in one press. (both when the target is a child and when using targetRef).
  3. Consider adding an example with onBackgroundPress to the example screen.

Technically there's no point to use onBackgroundPress with the new one.
But anyway I fixed it so at least people won't get a bug and still can do what they want

@lidord-wix
Copy link
Contributor

Few issues before reviewing the code -

  1. When using the targetRef prop with onBackgroundPress prop, the hint is rendered above its target.
  2. When passing onBackgroundPress you still can't press the target button in one press. (both when the target is a child and when using targetRef).
  3. Consider adding an example with onBackgroundPress to the example screen.

Technically there's no point to use onBackgroundPress with the new one. But anyway I fixed it so at least people won't get a bug and still can do what they want

As discussed, the new behaviour doesn't work with the onBackgroundPress prop

@ethanshar
Copy link
Collaborator Author

@lidord-wix
Ok, Im back to my original implementation and removed the targetRef prop since it doesn't really solves anything.
I played with different positions and overall it behave good (I think)
Let me know if you find something..

I'll change the PR description and changelog you can see details there

Copy link
Contributor

@lidord-wix lidord-wix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great now :)
Just need to clean two leftovers of the targetRef from the screen.
I'm approving so you can remove it and merge

}

export default class HintsScreen extends Component<HintScreenProps> {
targetRef = React.createRef();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't need it anymore

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

style={{alignSelf: targetPosition}}
testID={'Hint.button'}
ref={this.targetRef}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed. thanks

@ethanshar ethanshar changed the title Feat/hint target ref Feat/hint pressable target Nov 2, 2021
@ethanshar ethanshar enabled auto-merge (squash) November 2, 2021 12:24
@ethanshar ethanshar added the Important for Next Release PR that must be included in the release version label Nov 2, 2021
@ethanshar ethanshar merged commit a2b64f2 into master Nov 2, 2021
@ethanshar ethanshar deleted the feat/Hint_targetRef branch April 18, 2022 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Important for Next Release PR that must be included in the release version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants