Giter VIP home page Giter VIP logo

Comments (11)

sr2echa avatar sr2echa commented on April 19, 2024

If current tab has actions on keyboard (like escape key in telegram web) it overrides action in Omni, and Omni does not closing

Bro, just click outside the menu
It will exit

from omni.

dadyarri avatar dadyarri commented on April 19, 2024

Bro, just click outside the menu

I know, but there should be way to do it without mouse in that case

from omni.

sr2echa avatar sr2echa commented on April 19, 2024

Bro, just click outside the menu

I know, but there should be way to do it without mouse in that case

type something that gives 0 results [like hhhhhhhhhhhhhhh] and press enter

from omni.

alyssaxuu avatar alyssaxuu commented on April 19, 2024

I've been looking into this and honestly I haven't found a solution. I see on Telegram it requires pressing the Esc key two times to work, it can certainly be a bit annoying. Unsure if I can do anything about it, I considered making the Esc key an "official" command, but if you had an extension that was also using it that would cause issues. Would be interested to see if anyone knows how this could work - I'm assuming it's due to some event.stopPropagation() call?

from omni.

sr2echa avatar sr2echa commented on April 19, 2024

I've been looking into this and honestly I haven't found a solution. I see on Telegram it requires pressing the Esc key two times to work, it can certainly be a bit annoying. Unsure if I can do anything about it, I considered making the Esc key an "official" command, but if you had an extension that was also using it that would cause issues. Would be interested to see if anyone knows how this could work - I'm assuming it's due to some event.stopPropagation() call?

making an close Omni command will do right?

from omni.

alyssaxuu avatar alyssaxuu commented on April 19, 2024

I've been looking into this and honestly I haven't found a solution. I see on Telegram it requires pressing the Esc key two times to work, it can certainly be a bit annoying. Unsure if I can do anything about it, I considered making the Esc key an "official" command, but if you had an extension that was also using it that would cause issues. Would be interested to see if anyone knows how this could work - I'm assuming it's due to some event.stopPropagation() call?

making an close Omni command will do right?

Yes, closeOmni() makes the omnisearch close, the problem is how to make it trigger on the Esc key when Telegram seems to prevent it from propagating.

from omni.

sr2echa avatar sr2echa commented on April 19, 2024

Wont making an action close Omni that will call closeOmni() be acceptable?

from omni.

sr2echa avatar sr2echa commented on April 19, 2024

Or better, why not inject overide-hotkeys.js to the webpage while initiating omni ?

from omni.

alyssaxuu avatar alyssaxuu commented on April 19, 2024

Wont making an action close Omni that will call closeOmni() be acceptable?

No, there are many ways to close Omni already (clicking outside the omnisearch, pressing Esc, and pressing on the extension icon), and they all should work.

Or better, why not inject overide-hotkeys.js to the webpage while initiating omni ?

This wouldn't solve anything, the keypress event would still not propagate.

from omni.

sr2echa avatar sr2echa commented on April 19, 2024

overide-hotkeys.js

onkeydown = function(e){
  if(e.escKey.charCodeAt(0)){
    e.preventDefault();
  }
}

ig this would work

from omni.

alyssaxuu avatar alyssaxuu commented on April 19, 2024
onkeydown = function(e){
  if(e.escKey.charCodeAt(0)){
    e.preventDefault();
  }
}

Doesn't quite work, I ended up doing a different thing though and managed to fix it. A bit weird but basically listening for the keyup event outside jQuery did work, so I used that and then closed it through there.

from omni.

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.