mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 07:13:20 +00:00
Bug 1536264 - Only reset color / background / text-shadow for active options. r=jaws
Otherwise you see font changes when hovering, which is not really desirable. Differential Revision: https://phabricator.services.mozilla.com/D24116 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
8452fc14bc
commit
cdd51a7d35
@ -17,6 +17,13 @@ const MAX_ROWS = 20;
|
||||
// Minimum elements required to show select search
|
||||
const SEARCH_MINIMUM_ELEMENTS = 40;
|
||||
|
||||
// The properties that we should respect only when the item is not active.
|
||||
const PROPERTIES_RESET_WHEN_ACTIVE = [
|
||||
"color",
|
||||
"background-color",
|
||||
"text-shadow",
|
||||
];
|
||||
|
||||
// Make sure to clear these objects when the popup closes to avoid leaking.
|
||||
var currentBrowser = null;
|
||||
var currentMenulist = null;
|
||||
@ -352,8 +359,12 @@ function populateChildren(menulist, options, uniqueOptionStyles, selectedIndex,
|
||||
for (let property in style) {
|
||||
if (property == "direction" || property == "font-size")
|
||||
continue; // handled above
|
||||
if (style[property] != selectStyle[property]) {
|
||||
if (style[property] == selectStyle[property])
|
||||
continue;
|
||||
if (PROPERTIES_RESET_WHEN_ACTIVE.includes(property)) {
|
||||
ruleBody += `${property}: ${style[property]};`;
|
||||
} else {
|
||||
item.style.setProperty(property, style[property]);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user