Code Monkey home page Code Monkey logo

Comments (3)

gbj avatar gbj commented on June 15, 2024

Oof.

Is there a reason to think this might be a Chrome bug, or Chrome being spec-non-compliant? Comparison with other browsers would be good. The W3C UI Events spec is pretty explicit that keydown is a KeyboardEvent.

from leptos.

boyswan avatar boyswan commented on June 15, 2024

Hmm on closer inspection it looks like it's like a keydown event, but crucially missing the code/key fields.

On autocomplete:
Screenshot 2024-04-12 at 14 08 59

On "real" keydown:
Screenshot 2024-04-12 at 14 09 09

This is only happening on chrome, firefox works correctly

from leptos.

gbj avatar gbj commented on June 15, 2024

Yeah I'll be honest I'm not sure the best way to deal with this. From looking around a little, my impression is that this is a long-standing Chrome thing that will probably not change. On the other hand, it seems pretty clear to me that it's not compliant with the spec.

I guess there are three options:

  1. In a future version, make keydown a KeyboardEvent, which will be a breaking change and be less useful for users in the default case (all other browsers, and all non-autocomplete keydown events)
  2. Add some kind of runtime check, which will have a cost for all binary sizes and a runtime performance cost for the default case
  3. Document "hey, this is broken in Chrome, here's the workaround if you encounter it"

from leptos.

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.