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)
Change History (11)
This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.
2 months ago
#3
@
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:
↓ 5
@
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.
#5
in reply to: ↑ 4
@
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;
}
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:
- Bringing the CodeMirror scrollbars above the search dialog (
z-index: 16). - 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
I can reproduce this issue in both the plugin and theme file editors.
The problem happens because the search dialog has a higher
z-indexof 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.cssto 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.