Comments (13)
My first thought are these two segments
Line 56 in 45629f4
Line 65 in 45629f4
It specifies click, but I'd typically have a touch event recognized as well.
const clickHandler = 'ontouchstart' in document.documentElement ? 'touchstart' : 'click';
That would transform those segments to
const clickHandler = 'ontouchstart' in document.documentElement ? 'touchstart' : 'click';
!isServer(vNode) && document.addEventListener(clickHandler, handler)
const clickHandler = 'ontouchstart' in document.documentElement ? 'touchstart' : 'click';
!isServer(vNode) && document.removeEventListener(clickHandler, el.__vueClickOutside__.handler)
I'm going to be implementing this library and if I run into the same issue, I'll see if this is a proper solution. If it is I'll drop a quick PR in the process!
from click-outside.
@brennenf made the PR 😄
from click-outside.
@trollepierre I have no idea what came of this all.
My PR is still open and ready for merge, but the fix itself can be applied yourself if you need it.
I'm just as in the dark as you are at this point.
from click-outside.
@paquette The above fix worked for me. Thank you.
from click-outside.
Glad to help @brennenf totally forgot about this, I haven't made a PR yet!
from click-outside.
@paquette Actually, if you have the time would you mind making a PR? It would be helpful for project install automation to have the patched version on npm. No worries if not!
from click-outside.
So, is that issue closed?
from click-outside.
😞
from click-outside.
This package looks abandoned. For anyone trying to fix this, try : https://github.com/ndelvalle/v-click-outside, it supports touch events out of the box and was good for my case.
from click-outside.
Yeah it seems like it, I've had an open PR that's received no feedback or sign of merge whatsoever.
I have left the PR open and branch for so long because when I closed it and cleaned up some people emailed me asking where it had disappeared to, was hoping to get this merged sometime before the year 2045 but not looking hopeful at this point 😅
from click-outside.
Sweet, glad this is finally merged.
from click-outside.
Thanks.
from click-outside.
45629f4...v1.1.0
@pqt Published v1.1.0
from click-outside.
Related Issues (20)
- Error in mobile chrome on Android
- Is there a way to do this in Vue 1?
- Cannot call function with params HOT 3
- Does not work with IE11, but I have a fix
- Make the event trigger at the event capture stage HOT 3
- Event is fired on the same click that triggers the render of the component that uses the directive. HOT 2
- JS error on unbind HOT 2
- ES6 keyword "const" added to source: Breaking ES5 apps
- How to prevent click outside? HOT 1
- Export as IIFE for UNPKG
- mounted() function HOT 1
- 对element-ui里的select不生效
- button inside component with directive triggers event
- drag mouse outside element fires the event
- How to use in Vue 3 setup HOT 3
- Doesn't work in modal window HOT 2
- 如何暂时取消click-ouside效果?
- Doesn't work on vue 3
- TypeError: Cannot read property '$isServer' of undefined HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from click-outside.