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

Delay close on mouseout #108

Merged
merged 2 commits into from
Nov 8, 2015
Merged

Delay close on mouseout #108

merged 2 commits into from
Nov 8, 2015

Conversation

caseyWebb
Copy link
Contributor

Adds hoverDelay option and docs

@geekjuice
Copy link
Contributor

Awesome. We've had many requests for this so it's great to see a PR actually implementing this.

A few things before merging:

  1. Could you rebase with master to prevent merge conflicts? A few changes were just merged in and unfortunately made this PR conflicting.
  2. Could we use another name than hoverDelay? Maybe hoverCloseDelay or even closeDelay? This is primarily because we now support focus events for opening drops.
  3. Lastly, would you be interested in supplying an open delay as well? I would imagine it would be the same logic as the delayed close handler, but implemented for the open handler as well.

Otherwise, this look greats and I'll be happy to merge this soon 😸

@caseyWebb
Copy link
Contributor Author

As you wish

  • Renamed hoverDelay -> hoverCloseDelay
  • Added hoverOpenDelay, focusDelay, and blurDelay

@caseyWebb
Copy link
Contributor Author

I added documentation for the focus event as well, as that didn't seem to be in there

@geekjuice
Copy link
Contributor

Sorry for all this delay 😿

However, I'm back now and I should be able to reply quickly going forward. 👍

Everything looks good, but I was wondering if we should just combine the hoverOpenDelay and focusDelay and likewise for close to something more generic like openDelay and closeDelay. I imagine the use case for these delays to be consistent for both focus and hover rather than having to set them individually.

Other than that, LGTM and I'll merge this once I get some input about the above.

@geekjuice
Copy link
Contributor

Just bumping to see if you had any thoughts on my comments above? It also seems like the branch needs a rebase to resolve conflicts 👍

@fenixkim
Copy link

This feature is imprescindible, please make it official 👍

@caseyWebb
Copy link
Contributor Author

I made the changes your suggested, but I did a push -f and apparently that doesn't trigger notifications. Alas, there are more conflicts now anyway, so I can clean those up and ping you when ready for merge.

@caseyWebb
Copy link
Contributor Author

git-fu done, conflicts resolved.

I definitely see the argument for combining the hover and focus delays, however I can at least vouch for a desire for these to be separate. I'm using drop w/ tether-tooltips as part of my form validation, and while I like to show and hide the tooltips immediately on focus/blur, when they are hovered, I like to give users a chance to move the cursor over them so they can be clicked w/o them disappearing.

@geekjuice
Copy link
Contributor

Awesome!

I'll take a look at this ASAP. In regards to consolidating the open and close delay, I'll keep them separate for now. I may revisit this on a major version change and/or include a way to set both using one option. What I had in mind for the latter though was to set the other open or close delay if only one is provided. For example: if hoverDelay: 1000 but no focusDelay is provided, just set it as the 1000 provided by hoverDelay.

I'm mostly thinking out loud, but wanted to get it out there in case you had thought on that approach.

@caseyWebb
Copy link
Contributor Author

That makes plenty of sense. i.e., having open and close properties set both of their corresponding focus and hover props.

@@ -246,7 +246,11 @@ function createContext(options={}) {
targetOffset: '0 0',
enabled: false,
constraints: constraints,
addTargetClasses: this.options.addTargetClasses
addTargetClasses: this.options.addTargetClasses,
focusDelay: 0,
Copy link
Contributor

Choose a reason for hiding this comment

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

Everything looks good, but I think these delays should go here. These options are for Tether specifically. Understandably, it's a bit confusing since Drop also accept similar, if not the same options 😅

@geekjuice
Copy link
Contributor

Sorry for not catching the above. comment earlier 😓 Once that is settled, do you also mind running gulp version:minor && gulp build and I'll have this merged ASAP. 👍 🍻

@caseyWebb
Copy link
Contributor Author

It's all yours

geekjuice added a commit that referenced this pull request Nov 8, 2015
@geekjuice geekjuice merged commit 40189a9 into HubSpot:master Nov 8, 2015
@geekjuice
Copy link
Contributor

💥 Awesome! Thanks again for all this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants