mirror of
https://github.com/zotero/zotero.git
synced 2026-08-28 05:25:31 +00:00
fx153: Restore autocomplete popup sizing from the anchor element
Firefox now sizes autocomplete popups to their content (bug 2045828), so add the --panel-width calculation back instead of adjusting it.
This commit is contained in:
parent
06848ce17f
commit
d701c43862
1 changed files with 6 additions and 4 deletions
|
|
@ -514,10 +514,12 @@ function modify_omni {
|
|||
overflow: var(--moz-text-control-overflow);
|
||||
}' >> chrome/toolkit/res/forms.css
|
||||
|
||||
# By default, an autocomplete popup's width is calculated based on the input that opened it.
|
||||
# Allow an ancestor to designate itself as the width container instead. (For creator inputs.)
|
||||
replace_line 'aElement.getBoundingClientRect\(\).width' \
|
||||
'(aElement.closest(".autocomplete-popup-width-container") || aElement).getBoundingClientRect().width' \
|
||||
# Size an autocomplete popup to the input that opened it, or to an ancestor that designates
|
||||
# itself as the width container. Firefox sizes the popup to its content. (For creator inputs.)
|
||||
replace_line '\/\/ invalidate\(\) depends on the width attribute' \
|
||||
'let widthElement = aElement.closest(".autocomplete-popup-width-container") || aElement;
|
||||
this.style.setProperty("--panel-width", Math.max(widthElement.getBoundingClientRect().width, 100) + "px");
|
||||
\/\/ invalidate() depends on the width attribute' \
|
||||
chrome/toolkit/content/global/elements/autocomplete-popup.js
|
||||
|
||||
zip -qr9XD omni.ja *
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue