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

Add reset option to support dispatching onOut event when removing #33

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from

Conversation

seriouslysean
Copy link

@seriouslysean seriouslysean commented Mar 23, 2021

Solves #21 -- alternate solve to what #32 is doing.

--

This PR adds the option to reset the hoverintent usage when remove takes places. This optionally fires the onOut event to do any sort of cleanup required. The option is passed as a parameter to the remove event to keep things colocated where possible.

Also added an .nvmrc file with the recommended node version and the proper engine entries to the package.json files as the build function only ran in node version < 11.

@fabricioflores fabricioflores mentioned this pull request Mar 23, 2021
@@ -0,0 +1 @@
v10.24.0
Copy link
Author

Choose a reason for hiding this comment

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

Allows switching to the correct node version with something like nvm use or n auto.

Comment on lines +53 to +54
// Remove hoverintent and fire the out handler
hoverListener.remove(true);
Copy link
Author

Choose a reason for hiding this comment

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

Wasn't sure this was the right place for it, but wanted to show a real world usage. If this is intended as a snippet that can be copy/pasted, might be worth moving this to a different location.

@@ -107,8 +107,12 @@ module.exports = function(el, onOver, onOut) {
el.removeEventListener('blur', dispatchBlur, false);
}

h.remove = function() {
h.remove = function(reset) {
Copy link
Author

Choose a reason for hiding this comment

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

New param; if this is true the mouse out event will fire before removing the event listeners.

Comment on lines +6 to +9
"engine-strict": true,
"engines": {
"node": "^10.0.0"
},
Copy link
Author

Choose a reason for hiding this comment

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

Will require the correct node version so that the build script runs properly.

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

Successfully merging this pull request may close these issues.

None yet

1 participant