Git Product home page Git Product logo

Comments (5)

aesyondu avatar aesyondu commented on June 1, 2024

Confirmed. Mac OS X 10.14.6 here.

CMD + v works in:

  • Google Chrome 80.0.3987.116 (Official Build) (64-bit)
  • Firefox 74.0b6

I wonder what it could be.

from whocanuse.

aesyondu avatar aesyondu commented on June 1, 2024

Here are my findings:

In src/components/control/background.js, the first HexWrapper:

        onKeyPress={e => {
          console.log(123, e)
          const result = e.key.match(/[^0-9a-fA-F]/)
          console.log(444, result)
          if (result) {
            e.preventDefault()
          }
        }}
        onPaste={e => {
          console.log(456, e)
          const text = e.clipboardData.getData('Text')
          e.preventDefault()
          if (chroma.valid(text)) {
            setBackground(
              chroma(text)
                .alpha(1)
                .hex()
                .replace('#', ''),
            )
          }
        }}

Google Chrome outputs:

456 Class {dispatchConfig: {}, _targetInst: FiberNode, nativeEvent: ClipboardEvent, type: "paste", target: input.css-dwtz5p-HexWrapper.elv6yn64, …}

Safari outputs:

[Log] 123  Class {dispatchConfig: {phasedRegistrationNames: {bubbled: "onKeyPress", captured: "onKeyPressCapture"}, dependencies: ["keypress"], eventPriority: 0}, _targetInst: FiberNode, _dispatchListeners: function,} (commons.js, line 67529)
Class {dispatchConfig: {phasedRegistrationNames: {bubbled: "onKeyPress", captured: "onKeyPressCapture"}, dependencies: ["keypress"], eventPriority: 0}, _targetInst: FiberNode, _dispatchListeners: function, _dispatchInstances: FiberNode, nativeEvent: KeyboardEvent,}Class
[Log] 444  ["v"] (1) (commons.js, line 67529)

I'm not sure why they take different code paths.

from whocanuse.

aesyondu avatar aesyondu commented on June 1, 2024

Filed webkit bug here:
https://bugs.webkit.org/show_bug.cgi?id=208088

Relevant demo:
https://codepen.io/aesyondu/pen/KKpNXEX

from whocanuse.

aesyondu avatar aesyondu commented on June 1, 2024

Temporary workaround:
Right click > Paste

from whocanuse.

CoreyGinnivan avatar CoreyGinnivan commented on June 1, 2024

Absolute legend, thanks!

from whocanuse.

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.