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

WordPress Trac noreply at wordpress.org
Sun Sep 23 15:26:37 UTC 2018


#42586: Code Editor: Inconsistent results between finding in CodeMirror vs browser
--------------------------+--------------------------------------------
 Reporter:  wpress2010    |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  high          |   Milestone:  Future Release
Component:  General       |     Version:  4.9
 Severity:  major         |  Resolution:
 Keywords:  needs-patch   |     Focuses:  accessibility, administration
--------------------------+--------------------------------------------

Comment (by afercia):

 Looking at what's left to do, see comment:22

 I see codemirror uses a `cm-searching` CSS class to highlight all the
 matches but I couldn't find any CSS class used for the current "active"
 match so I'm not sure this can be done. Anyone have found a way to do it?
 Otherwise I'm afraid there's nothing we can do and it should be addressed
 upstream.

 > Another is that the current implementation only works if the CodeMirror
 window has focus, this is not the default state, so if I pick a file to
 edit and then instantly hit ctrl/cmd+f to find what i need, I'll still get
 the browser search. It might be worth considering either auto-focusing the
 editor, or hijacking the search command on the editor pages only to
 provide a better user experience.

 I kindly disagree :)
 - auto-focusing is an option when there's only one, very specific, task to
 complete and there are no other possible workflows (e.g. landing in a page
 or a modal with nothing else then a form to fill in). This is not the case
 in this page, where there are many possible workflows and auto-focusing
 the editor would be far from ideal for keyboard users
 - native browser functionalities shouldn't be "hijacked" unless there's a
 really, really, good reason to do that. Making the `Alt+F / Ctrl/Cmd+F`
 search limited to the editor area would not allow to search in the rest of
 the page: as a used, I would like to search, for example, in the list of
 files in the sidebar (which can be pretty long) or in any other part of
 the page

 @SergeyBiryukov @Clorith given the above, not sure this ticket should stay
 open :) thoughts?

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


More information about the wp-trac mailing list