Page MenuHomePhabricator

Kill slow MutationObserver stuff in TextInputWidget
Open, Needs TriagePublic

Description

All the MutationObserver stuff in TextInputWidget, which calls #adjustSize for autosized inputs after they're inserted into the document, is slow. There is some overhead for creating the MutationObserver, it (probably) slows down DOM operations a little bit, the handler for it is executed with some delay, and when building an interface with many TextInputWidgets, each of them runs separately and causes a separate reflow when #adjustSize is called. We really should find a way to do this less often, or not at all.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 23 2016, 12:36 PM
Esanders added a subscriber: Esanders.EditedAug 7 2018, 11:51 AM

Another issue is that onAttach isn't necessarily the correct time to auto-size the widget, for example if a widget is attached to a still-animating dialog (cf T200834).