From dfd8f7a1b1a5dae496e23910cf0f6f470ecbb28f Mon Sep 17 00:00:00 2001 From: tophf Date: Sat, 11 Sep 2021 15:53:10 +0300 Subject: [PATCH] fix regexp report overflow (#1332) --- edit/edit.css | 13 ++++++++----- edit/regexp-tester.js | 3 +-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/edit/edit.css b/edit/edit.css index b2e9bbde..add1eee8 100644 --- a/edit/edit.css +++ b/edit/edit.css @@ -675,7 +675,7 @@ body:not(.find-open) [data-match-highlight-count="1"] .CodeMirror-selection-high margin-left: 1rem; word-break: break-all; } -.regexp-report details:not(:last-child) { +.regexp-report details { margin-bottom: 1rem; } .regexp-report summary { @@ -698,6 +698,10 @@ body:not(.find-open) [data-match-highlight-count="1"] .CodeMirror-selection-high margin-left: 2rem; margin-top: .5rem; } +.regexp-report details div { + max-height: calc(100vh - 15rem); + overflow-y: auto; +} .regexp-report .svg-icon { position: absolute; margin-top: -1px; @@ -714,14 +718,13 @@ body:not(.find-open) [data-match-highlight-count="1"] .CodeMirror-selection-high .regexp-report details a img { width: 16px; max-height: 16px; - position: absolute; - margin-left: -20px; - margin-top: -1px; + vertical-align: middle; + margin-right: .5em; } .regexp-report-note { color: #999; position: absolute; - margin: 0 0.5rem 0 0; + bottom: 0; hyphens: auto; } /************ help popup ************/ diff --git a/edit/regexp-tester.js b/edit/regexp-tester.js index 8d9f06cc..3879f178 100644 --- a/edit/regexp-tester.js +++ b/edit/regexp-tester.js @@ -135,8 +135,7 @@ const regexpTester = (() => { block.appendChild( $create('details', {open: true}, [ $create('summary', text), - // 3rd level: tab urls - ...urls, + $create('div', urls), ])); } else { // type is none or invalid