Giter Club home page Giter Club logo

Comments (13)

pqt avatar pqt commented on July 17, 2024 9

My first thought are these two segments

!isServer(vNode) && document.addEventListener('click', handler)

!isServer(vNode) && document.removeEventListener('click', el.__vueClickOutside__.handler)

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.

pqt avatar pqt commented on July 17, 2024 2

@brennenf made the PR 😄

from click-outside.

pqt avatar pqt commented on July 17, 2024 2

@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.

brennenf avatar brennenf commented on July 17, 2024

@paquette The above fix worked for me. Thank you.

from click-outside.

pqt avatar pqt commented on July 17, 2024

Glad to help @brennenf totally forgot about this, I haven't made a PR yet!

from click-outside.

brennenf avatar brennenf commented on July 17, 2024

@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.

trollepierre avatar trollepierre commented on July 17, 2024

So, is that issue closed?

from click-outside.

littlee avatar littlee commented on July 17, 2024

😞

from click-outside.

vasisouv avatar vasisouv commented on July 17, 2024

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.

pqt avatar pqt commented on July 17, 2024

Yeah it seems like it, I've had an open PR that's received no feedback or sign of merge whatsoever.

#17

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.

pqt avatar pqt commented on July 17, 2024

Sweet, glad this is finally merged.

from click-outside.

fundon avatar fundon commented on July 17, 2024

Thanks.

from click-outside.

fundon avatar fundon commented on July 17, 2024

45629f4...v1.1.0
@pqt Published v1.1.0

from click-outside.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.