From 1da42e8b8eb767b7bfdaeb6770a34efe029f275a Mon Sep 17 00:00:00 2001 From: Brendan Dahl Date: Tue, 1 Jun 2021 15:25:40 -0700 Subject: [PATCH] Fix find highlighting regression from #13306. When we insert extra spans for highlighting we want them to be positioned normally instead of absolute or relative. Fixes #13345. --- web/text_layer_builder.css | 5 ++++- web/text_layer_builder.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/web/text_layer_builder.css b/web/text_layer_builder.css index 99c2b2c55..07ff4930b 100644 --- a/web/text_layer_builder.css +++ b/web/text_layer_builder.css @@ -34,13 +34,16 @@ } .textLayer .highlight { - position: relative; margin: -1px; padding: 1px; background-color: rgba(180, 0, 170, 1); border-radius: 4px; } +.textLayer .highlight.appended { + position: initial; +} + .textLayer .highlight.begin { border-radius: 4px 0 0 4px; } diff --git a/web/text_layer_builder.js b/web/text_layer_builder.js index f722515be..e5a17b9af 100644 --- a/web/text_layer_builder.js +++ b/web/text_layer_builder.js @@ -239,7 +239,7 @@ class TextLayerBuilder { const node = document.createTextNode(content); if (className) { const span = document.createElement("span"); - span.className = className; + span.className = `${className} appended`; span.appendChild(node); div.appendChild(span); return;