This repository has been archived by the owner on Mar 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 55
feat(Popup): added on
prop for triggering the popup on click, hover or focus
#622
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…er event of the popup on click or hover -added usage examples
mnajdova
requested review from
dvdzkwsk,
kuzhelov,
layershifter,
levithomason and
miroslavstastny
as code owners
December 17, 2018 13:43
jurokapsiar
reviewed
Dec 17, 2018
-copied handlers on the primitive content element
-hover should by default add the focus handler as well
# Conflicts: # CHANGELOG.md # src/components/Popup/PopupContent.tsx
-fixed examples imports
mnajdova
changed the title
feat(Popup): added
feat(Popup): added Dec 21, 2018
on
prop for triggering the popup on click or hoveron
prop for triggering the popup on click, hover or focus
sophieH29
reviewed
Dec 21, 2018
sophieH29
reviewed
Dec 21, 2018
sophieH29
reviewed
Dec 21, 2018
sophieH29
reviewed
Dec 21, 2018
-hover on blur should close the popup -rearranged the examples for the on prop
-refactoring on the blur conditions
# Conflicts: # CHANGELOG.md
layershifter
reviewed
Jan 2, 2019
docs/src/examples/components/Popup/Usage/PopupExampleOnWithFocusTrap.shorthand.tsx
Outdated
Show resolved
Hide resolved
layershifter
reviewed
Jan 2, 2019
docs/src/examples/components/Popup/Usage/PopupExampleOnWithFocusTrap.shorthand.tsx
Outdated
Show resolved
Hide resolved
layershifter
reviewed
Jan 2, 2019
@@ -63,6 +71,9 @@ export interface PopupProps | |||
*/ | |||
offset?: string | |||
|
|||
/** Events triggering the popup. */ | |||
on?: PopupEvents | PopupEventsArray |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to restrict using 'click' together with 'hover'. Adding the array ['click', 'click'] is not a bug, so I don't know it we want to add some other restrictions for this.
levithomason
previously requested changes
Jan 7, 2019
docs/src/examples/components/Popup/Usage/PopupExampleOnMultiple.shorthand.tsx
Show resolved
Hide resolved
miroslavstastny
approved these changes
Jan 8, 2019
2 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR aims to solve #620 by adding
on
prop on the Popup, that can receive one of the valuesclick
,hover
,focus
, or array of these (except theclick
andhover
cannot be defined at the same time), thus allowing the user to specify the event that should trigger the popup. In addition to this, there is new property addedmouseLeaveDelay
that is representing the delay in ms for the mouse leave event, before the popup will be closed (There must be some timeout before the mouse is moved form the trigger to the content of the popup, and the popup should not be closed in that period. This property is defining how long that timeout should be - the default is 500ms).TODO:
hover
value is specified, because of accessibility consistency, we have to open the popup on click (enter/space)