Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
select: Don't touch dimensions of DOM elements if not necesary #1595
Conversation
Both access to CSS `min-width` and DOM `offsetWidth` trigger Layout and Paint events in browsers. This may lead to unexpected delays during selects' initialization. With this changes dimensions are touched only before `menu` block is going to become visible or if `button`'s width was potentionaly changed.
Could you add some numbers showing something? |
Sure 600 and 1200. Just kidding :)) Here are two pages with 30
Click on the "Очистить" button leads to synchronous initialisation of all As we have a lot of "Forced synchronous layout" calls during |
|
select: Don't touch dimensions of DOM elements if not necesary
narqo commentedJul 22, 2015
Both access to CSS
min-width
and DOMoffsetWidth
trigger Layout and Paint events in browsers. This may lead to unexpected delays during selects' initialisation.With this changes dimensions are touched only before
menu
block is going to become visible or ifbutton
's width was potentially changed./cc @dfilatov