Make WordPress Core

Opened 2 months ago

Last modified 7 weeks ago

#66124 new defect (bug)

Search form hides the top button of the vertical scrollbar inside the plugin/theme file editor

Reported by: alanjacobmathew Owned by:
Priority: normal Milestone: Awaiting Review
Component: Editor Version:
Severity: normal Keywords: has-screenshots has-patch
Cc: Focuses: ui, accessibility

Description

When using the search (CTRL + F) inside the default plugin/theme file editors, the search form field stays above the Top button of the vertical scroll bar. On some instances, it even hides the slider.

Attachments (2)

3HIABwxquM.png​ (55.7 KB ) - added by alanjacobmathew 2 months ago.
plugin-search-WP5.4.png​ (73.0 KB ) - added by sabernhardt 2 months ago.
Plugin file search, with multiple results highlighted, in WordPress 5.4

Download all attachments as: .zip

Change History (11)

#1 @sainathpoojary
2 months ago

I can reproduce this issue in both the plugin and theme file editors.

The problem happens because the search dialog has a higher z-index of 15 than the scrollbar elements of 6.

A safe way to fix this is could be by adding a CSS override in wp-admin/css/code-editor.css to bring the scrollbar forward:

.CodeMirror-gutter-filler,
.CodeMirror-hscrollbar,
.CodeMirror-scrollbar-filler,
.CodeMirror-vscrollbar {
	z-index: 16;
}

Please let me know if this approach looks good and it is in the right direction.

I am happy to raise a PR.

This ticket was mentioned in ​Slack in #accessibility by joedolson. ​View the logs.


2 months ago

#3 @joedolson
2 months ago

Most likely, this was caused by the increase in input height in the 7.0 design refresh. I think it would potentially make more sense to check the heights in use in that CSS area to see what impact the input height had.

#4 follow-up: @alanjacobmathew
2 months ago

Most likely, this was caused by the increase in input height in the 7.0 design refresh.

Issue exists on 6.5.11, 6.0.15, 5.9.17 etc.

@sabernhardt
2 months ago

Plugin file search, with multiple results highlighted, in WordPress 5.4

#5 in reply to: ↑ 4 @sabernhardt
2 months ago

I was able to reproduce the issue with WordPress 5.4, and #42586 has some screenshots from 4.9(.x). This probably should be fixed in the external library.

I am inclined to agree with increasing the z-index for the scrollbar-related elements, which would require increasing at least the right padding on the dialog to about 2em. Or all sides could be set to desired pixel values to fit the WordPress administration:

.CodeMirror-dialog {
	padding: 4px 24px 4px 8px;
}
Last edited 2 months ago by sabernhardt (previous) (diff)

This ticket was mentioned in ​PR #13668 on ​WordPress/wordpress-develop by ​@sainathpoojary.


2 months ago
#6

  • Keywords has-patch added

In the plugin and theme file editors, pressing <kbd>Ctrl</kbd>/<kbd>Cmd</kbd> + <kbd>F</kbd> opens a search bar at the top of the editor. Because the search bar has a higher z-index than the scrollbar, it sits on top of the vertical scrollbar, hiding the scrollbar.

This PR fixes the issue by:

  1. Bringing the CodeMirror scrollbars above the search dialog (z-index: 16).
  2. Adding padding to the search dialog so the input box and text don't sit under the vertical scrollbar.

Trac ticket: https://core.trac.wordpress.org/ticket/66124

Use of AI Tools

AI assistance: Yes
Tool(s): Github Copilot
Used for: Assistance with the PR description.

​@alanjacobmathew commented on ​PR #13668:


8 weeks ago
#7

Testing on playground, I can see the changes in files but the search bar still stays on top of that button.

`
.CodeMirror-gutter-filler, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-vscrollbar {

z-index: 16;

}
`
gets overwritten by

`
.CodeMirror-gutter-filler, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-vscrollbar {

position: absolute;
z-index: 6;
display: none;
outline: 0;

}
`
which loads the css from wp-includes/js/codemirror/codemirror.min.css?ver=5.65.20

​@sainathpoojary commented on ​PR #13668:


7 weeks ago
#8

Good catch. The issue is that in WordPress Playground, stylesheets are combined via load-styles.php and the load order is not guaranteed, so codemirror.min.css can end up loading after code-editor.css and overriding the z-index.

To fix this, I updated the selector to .CodeMirror .CodeMirror-vscrollbar (and the other scrollbar elements). This gives our rule higher specificity than the library's rule, so it wins regardless of load order

​@alanjacobmathew commented on ​PR #13668:


7 weeks ago
#9

Tested on WP 7.2 Alpha, Theme: T25

Works as expected. Now the button/icon is visible and accessible.

https://github.com/user-attachments/assets/cc6d36a7-5514-4ea4-9333-5bceafcd0f5a

Note: See TracTickets for help on using tickets.