You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In Firefox, the draggable and contenteditable attributes don't play well. Therefore, there is logic inside it that removes the draggable attribute when you click inside the contenteditable element.
However, this logic does not apply to input and textarea elements, as they do not have the contenteditable attribute, even though they have text that is clickable with the mouse.
How?
Add a check whether the clicked element is input or textearea element or not. I would have liked to use the isInputOrTextArea() function, but it's not exposed.
Testing Instructions
Open Firefox.
Core Blocks
Insert the Embed, Shortcode, and Custom HTML blocks.
Insert a Paragraph block and switch to HTML editing mode.
Confirm that you can select the text with the mouse.
Confirm that the you can drag & drop a block as before (Example: Drag inside the embedded block and outside the text field.)
HTML Native Elements
Paste the following code into the browser console panel. If you can't paste, access about:config and set dom.event.clipboardevents.enabled to false.
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.
If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #69779
Related PRs:
cc @ellatrix @youknowriad
What?
This PR fixes an issue where when a block contains
input
ortextarea
, its values cannot be selected with the mouseclick.Why?
This problem is related to the Firefox bug: - 965800 - Text cursor (caret) ignores mouse click on inputs with draggable parent
In Firefox, the
draggable
andcontenteditable
attributes don't play well. Therefore, there is logic inside it that removes thedraggable
attribute when you click inside thecontenteditable
element.However, this logic does not apply to
input
andtextarea
elements, as they do not have thecontenteditable
attribute, even though they have text that is clickable with the mouse.How?
Add a check whether the clicked element is
input
ortextearea
element or not. I would have liked to use theisInputOrTextArea()
function, but it's not exposed.Testing Instructions
Core Blocks
HTML Native Elements
Paste the following code into the browser console panel. If you can't paste, access
about:config
and setdom.event.clipboardevents.enabled
tofalse
.Code
input[type="number"]
textarea
Screenshots or screencast
Berfore
84ea1887334476819d79f8e40b548df8.mp4
After
83f45e60ceb5b6b555218db6e3f360f3.mp4