code-input icon indicating copy to clipboard operation
code-input copied to clipboard

Jump to find-and-replace matches only scrolls horizontally not vertically with Prism on Firefox

Open WebCoder49 opened this issue 1 year ago • 1 comments

With the find-and-replace plugin, the up and down arrow buttons/enter key should move between all the found matches.

They do so in most cases, with both highlighting engines on Chrome, but not with Prism.js on Firefox, where the horizontal scrolling occurs as well as the match colour changes, but the vertical scrolling to the match does not.

(All tests on Firefox/Chromium on Wayland on EndeavourOS Arch Linux.)

WebCoder49 avatar Oct 23 '24 13:10 WebCoder49

This bug occurs in v2.3.1 (the CodePen demo) and v2.4.0 (tests folder) of code-input.

WebCoder49 avatar Oct 23 '24 13:10 WebCoder49

Still reproducible on main.

WebCoder49 avatar Jul 18 '25 21:07 WebCoder49

On current main branch, offsetTop of highlighted spans is zero when prism line numbers is used, but not when prism is used without line numbers (but codeInput's prism line numbers compatibility is imported).

Prism's line numbers code is the issue.

WebCoder49 avatar Jul 24 '25 17:07 WebCoder49