New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't paste values through CMD+V in Safari Mac 13.0.5 #31
Comments
Confirmed. Mac OS X 10.14.6 here. CMD + v works in:
I wonder what it could be. |
Here are my findings: In 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. |
Filed webkit bug here: Relevant demo: |
Temporary workaround: |
Absolute legend, thanks! |
Hi there,
like stated in the subject I can't paste a hex value into the input fields with a CMD+V shortcut in Safari 13.0.5. I'm running Safari on Mojave.
Best regards,
Atilla
The text was updated successfully, but these errors were encountered: