Edit and resend panel has many scrollbars when viewport is narrow
Categories
(DevTools :: Netmonitor, enhancement)
Tracking
(firefox104 fixed)
| Tracking | Status | |
|---|---|---|
| firefox104 | --- | fixed |
People
(Reporter: jdescottes, Assigned: jdescottes)
References
(Blocks 1 open bug)
Details
Attachments
(2 files, 3 external files)
Small UX issue, resizing the panel creates too many scrollbars
| Assignee | ||
Comment 1•4 years ago
|
||
Comment 2•4 years ago
|
||
I quickly looked into this last week but couldn't find a fix.
The scrollable elements are <textarea>s that we automatically grow with a CSS trick: the ::after pseudo-element renders the same text as the textarea (see https://searchfox.org/mozilla-central/rev/3cb31675aeffd10f1f6ae7c40e24b254da7798e5/devtools/client/netmonitor/src/assets/styles/HTTPCustomRequestPanel.css#26-54)
But it looks like the text in the pseudo element doesn't break at the same position as the text in the textarea (see attached screenshot)
I tried to make both the textarea and the pseudo element to share the exact same dimension (e.g. margins are not the same at the moment), and have the exact same break-* values, without success so far
| Assignee | ||
Comment 3•4 years ago
|
||
Each line of the edit and resend panel should no longer grow when resizing the panel
But when editing, we fallback to multiline
Updated•4 years ago
|
Comment 4•4 years ago
|
||
In the end I had something working decently (I think)
# HG changeset patch
# User Nicolas Chevobbe <nchevobbe@mozilla.com>
# Date 1658137719 -7200
# Mon Jul 18 11:48:39 2022 +0200
# Node ID 0439a40a1d90017a0ca7cf22b328f320dcd367e5
# Parent a3abb49ac2b19777b4e2ec8ff4411fa32213ecfe
Bug 1779972 - [devtools] Fix scrollbar issue
diff --git a/devtools/client/netmonitor/src/assets/styles/HTTPCustomRequestPanel.css b/devtools/client/netmonitor/src/assets/styles/HTTPCustomRequestPanel.css
--- a/devtools/client/netmonitor/src/assets/styles/HTTPCustomRequestPanel.css
+++ b/devtools/client/netmonitor/src/assets/styles/HTTPCustomRequestPanel.css
@@ -26,13 +26,15 @@
.auto-growing-textarea {
display: grid;
width: 100%;
+ /* Adding this to have maximo 5 lines */
+ max-height: 70px;
+ overflow-x: hidden;
+ overflow-y: auto;
}
.auto-growing-textarea::after {
content: attr(data-replicated-value) " ";
- white-space: pre-wrap;
visibility: hidden;
- word-wrap: break-word;
}
.auto-growing-textarea > textarea {
@@ -48,11 +50,14 @@
min-width: 9ch;
padding: 4px;
padding-inline-start: 7px;
- /* Adding this to have maximo 5 lines */
- max-height: 70px;
- overflow-y: auto;
+ margin: 0;
+ box-sizing: border-box;
+ line-height: 13px;
+ white-space: pre-wrap;
+ word-wrap: break-word;
}
but I'm fine with Julian's approach
| Assignee | ||
Comment 5•4 years ago
|
||
Depends on D152006
Forcing name and values to one line, we should add a tooltip to show the whole content
| Assignee | ||
Comment 6•4 years ago
|
||
Depends on D152008
Spotted a few HTML ids which were used in loops or shared components, and ended up duplicated
Comment 8•4 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/8e28cece988b
https://hg.mozilla.org/mozilla-central/rev/fd01fd54b861
https://hg.mozilla.org/mozilla-central/rev/39969dab34cb
Description
•