[wp-trac] [WordPress Trac] #42586: Code Editor: Inconsistent results between finding in CodeMirror vs browser

WordPress Trac noreply at wordpress.org
Thu Nov 17 23:54:13 UTC 2022


#42586: Code Editor: Inconsistent results between finding in CodeMirror vs browser
-------------------------------------------+-----------------------------
 Reporter:  wpress2010                     |       Owner:  (none)
     Type:  defect (bug)                   |      Status:  new
 Priority:  normal                         |   Milestone:  Future Release
Component:  Administration                 |     Version:  4.9
 Severity:  major                          |  Resolution:
 Keywords:  needs-patch changes-requested  |     Focuses:  accessibility
-------------------------------------------+-----------------------------
Changes (by ironprogrammer):

 * keywords:  needs-patch close => needs-patch changes-requested
 * priority:  high => normal


Comment:

 Following up on this report. Thank you to everyone who has contributed so
 far!

 To summarize for historical context:

 - The [#ticket original report] was that `Ctrl-F` did not work as
 expected, but [https://core.trac.wordpress.org/ticket/42586#comment:10 was
 later confirmed as working again].
 - Subsequently, r42625 added support to press `Return/Enter` after a
 `Ctrl-F` search to advance to the next result, while leaving the search
 box visible.
 - However, the `Ctrl/Cmd-F` key modifiers introduced in r42625 appear to
 cause the loss of "focused" search result highlighting described in
 comment:22. (See comment:50.)
 - [https://core.trac.wordpress.org/ticket/42586#comment:39 Discussion also
 followed] whether the code editor should hijack the browser's default
 `Ctrl/Cmd-F` functionality.
 - It's worth clarifying that since its adoption to core, CodeMirror's
 [https://github.com/codemirror/codemirror5/blob/ee20357d279bf9edfed0047d3bf2a75b5f0a040f/src/input/keymap.js
 default mappings] define "Find" as `Ctrl/Cmd-F`, "Find Next" as
 `Ctrl/Cmd-G`, and "Find Previous" as `Shift-Ctrl/Cmd-G`.

 === Next Steps
 Because r42625 introduced the "focused" highlight regression in
 comment:22, and this update has been around several years (I don't think
 we can revert at this point), this ticket should remain open until the
 regression has been addressed. So I'm removing the `close` keyword, and
 marking for `changes-requested`.

 Also, because this ticket has been reviewed repeatedly in
 [https://wordpress.slack.com/archives/C02RP4X03 #accessibility], and the
 `high` priority is questioned each time, I've marked as `normal`.

 === Optional Follow-Ups
 - If anyone feels strongly that the browser's default Find key mappings
 should be overridden by the code editor, this should be explored in a new
 ticket.
 - The CodeMirror version used in core is
 [https://github.com/codemirror/codemirror5/tree/ee20357d279bf9edfed0047d3bf2a75b5f0a040f
 v5.29.1-alpha-ee20357], and hasn't been updated in some time. CodeMirror 5
 is currently
 [https://github.com/codemirror/codemirror5/releases/tag/5.65.9 v5.65.9]
 (and completely overhauled in [https://github.com/codemirror/dev version
 6]).

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/42586#comment:51>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list