Typing into multiline contact fields scrolls to top of contact edit area, sometimes breaks layout completely
Categories
(Thunderbird :: Address Book, defect)
Tracking
(thunderbird_esr102+ fixed, thunderbird102 wontfix, thunderbird103 wontfix)
People
(Reporter: neil, Assigned: u695164)
References
(Blocks 1 open bug)
Details
Attachments
(3 files)
13.75 KB,
image/png
|
Details | |
48 bytes,
text/x-phabricator-request
|
wsmwk
:
approval-comm-esr102+
|
Details | Review |
48 bytes,
text/x-phabricator-request
|
wsmwk
:
approval-comm-esr102+
|
Details | Review |
When you input into a multiline contact field, the field is scrolled to the top of the contact edit area. (Sometimes the layout breaks completely but I wasn't able to reproduce this reliably.) This appears to be because scrollIntoView
is used with its default behaviour of scrolling to the top. Perhaps you wanted to use scrollIntoView({ block: "nearest" })
?
Comment 1•3 years ago
|
||
Thanks Neil!
However, this worksforme on 102.0b8 (64-bit), Win10 - just scrolls the input area into view, but not to top, and no layout breakage at all.
Please provide more detail:
- exact TB version
- your OS
- Does this happen with
≡ > Help > Troubleshoot Mode…
? - STR
- Screenshots/Screencast of actual result
Updated•3 years ago
|
Reporter | ||
Comment 2•3 years ago
|
||
I found some repeatable steps for the layout bustage:
- Click New Contact
- Click all of the ⊕ options (Add web site... Add organisational properties)
- Enter data into the Street, Notes and Organisation fields
Thunderbird 102.0b8 (32-bit), Windows 10. Problem also occurs in troubleshooting mode.
I can confirm this issue on Thunderbird Daily 64bit, Windows 10.
I'm currently unable to tell what the exact threshold is. But it seems that there is a threshold when the scroll able content in the edit view is greater than a certain height problems with focus appear on input/textarea/selects.
This problem is mostly prominent by typing in a textarea. But it also happened to me by activating a button with the space key (with enter this problem doesn't occur).
Display resolution height 1050
<div class="contact-header">[...] 100px height
<vcard-edit>[...] 1122.27px height
The issue is not present
With the same numbers besides
<vcard-edit>[...] 1137.97 height
the error occurs.
I could also reproduce this issue on linux64.
The html tag in the xul:browser element with the id addressBookTabBrowser0 is behaving weird.
A temporary fix could be to position the body tag absolute in the addressBookTabBrowser0 element. But I'm pretty sure that this is not a fix for the real issue.
By pressing space to activate a button or typing in a textarea with a high enough height in the edit contact
the html element escaped the box of the parent. With a position: fixed;
this behaviour is supressed.
Updated•3 years ago
|
Comment 6•3 years ago
|
||
Space, and Shift+Space cause the about:addressbook Window
to scroll. This is the default response to keydown when Space is pressed in a page, but it shouldn't trigger when focusing a button. But it only seems to be effecting the buttons in the <form>
element, which is strange.
If we can't find the origin and fix it, then I think the better response would be to prevent the #addressBookTabBrowser
content window from scrolling, or restore scrollY
to 0 whenever it changes.
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/bdc6aef06066
Surpress scrolling of the Address Book html tag. r=aleca
Comment 8•3 years ago
|
||
I can still get the strange scroll behaviour when pressing Space on the Cancel or Save buttons when editing an existing contact. The Cancel one is easier to see when the dialog pops up. Strangely, I don't get it for the Delete button, and I don't get it when filling out the form for a new contact. Maybe that is a hint as to the origin. Seems like a mozilla-central issue.
We might need another Event.preventDefault
for these two buttons (or their container). However, given the only solutions we have is hacks right now, it might be better to choose a solution that keeps the hacks small and in one place. So overall, maybe we should stick to the original CSS hack
body { position: fixed; }
or if we prefer javascript, use
abDocument.addEventListener("scroll", () => { abWindow.scrollTo({ top: 0 }); });
as a smaller, more general patch whilst the exact cause remains unknown.
Comment 9•3 years ago
•
|
||
As a follow up for debugging. During editing, the addressbook <html>
element has a scrollHeight
that exceeds the viewport height. If you put overflow: scroll
on the toplevel, to replace the overflow: clip
(https://searchfox.org/comm-central/rev/88e1abf44865d212a266f2c8f295f2e64dcbf78d/mail/themes/shared/mail/messenger.css#18), then it makes it visible and you can scroll it as normal. But below the page content is just whitespace.
So the problem appears to be:
- The toplevel
<html>
under thexul:browser
is assigned too much space when the edit form is displayed, resulting in a largescrollHeight
. I've seen something similar with XUL layout not understanding the CSS grid layout, so maybe something similar is happening here. - Really, pressing Space shouldn't be scrolling
overflow: clip
because user and programmatic scrolling is meant to be prevented under this option. But since this is a toplevel element, the usual styling rules aren't always respected. - Pressing Space to activate a button shouldn't be propagating to the toplevel and used to scroll.
Assignee | ||
Comment 10•3 years ago
|
||
As by henry described the issue is happening when using Space or Shift + Space on the buttons Cancel or Save.
Shall we prevent the behaviour on the buttons or use a band aid fix for this behaviour?
Comment 11•3 years ago
|
||
Pressing Space to activate a button shouldn't be propagating to the toplevel and used to scroll.
I would suggest preventing the event propagation on Space
keypress for those buttons, and avoid hijacking the document scroll event or other things.
We could also experiment with wrapping the whole area around a parent DIV in order to not style the body
as a CSS grid. I'm not sure if that would do anything.
Comment 12•3 years ago
|
||
re-opening for the "Cancel" and "Save" buttons (comment 8)
Assignee | ||
Comment 13•3 years ago
|
||
Comment 14•3 years ago
|
||
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/9b4bfa71b01f
Surpress Address Book html scrolling on save and cancel. r=aleca
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Assignee | ||
Comment 15•3 years ago
|
||
Comment on attachment 9283370 [details]
Bug 1776278 - Surpress scrolling of the Address Book html tag. r=aleca
[Approval Request Comment]
Regression caused by (bug #):
User impact if declined: When pressing space on a button in the edit of a contact the layout breaks if there are a more elements in the edit view.
Testing completed (on c-c, etc.): on c-c
Risk to taking this patch (and alternatives if risky): Low
Assignee | ||
Comment 16•3 years ago
|
||
Comment on attachment 9287260 [details]
Bug 1776278 - Surpress Address Book html scrolling on save and cancel. r=aleca
[Approval Request Comment]
Regression caused by (bug #):
User impact if declined: When pressing space on the cancel or save button in the edit of a contact the layout breaks if there are a more elements in the edit view.
Testing completed (on c-c, etc.): on c-c
Risk to taking this patch (and alternatives if risky): Low
Comment 17•3 years ago
|
||
Comment on attachment 9283370 [details]
Bug 1776278 - Surpress scrolling of the Address Book html tag. r=aleca
[Triage Comment]
Approved for beta
Comment 18•3 years ago
|
||
Comment on attachment 9287260 [details]
Bug 1776278 - Surpress Address Book html scrolling on save and cancel. r=aleca
[Triage Comment]
Approved for beta
Updated•3 years ago
|
Comment 19•3 years ago
|
||
Comment on attachment 9283370 [details]
Bug 1776278 - Surpress scrolling of the Address Book html tag. r=aleca
(already on beta)
[Triage Comment]
Approved for esr102
Comment 20•3 years ago
|
||
Comment on attachment 9287260 [details]
Bug 1776278 - Surpress Address Book html scrolling on save and cancel. r=aleca
(already on beta)
[Triage Comment]
Approved for esr102
Comment 21•3 years ago
|
||
bugherder uplift |
Description
•