fix(core): 🐛 emit resize event after clientPref change

Various apps listen to window resize events to reposition absolutely positioned elements
This commit is contained in:
alistair3149 2024-10-28 16:04:51 -04:00
parent 50c30afa23
commit c37560a2a9
No known key found for this signature in database

View file

@ -83,6 +83,9 @@ function toggleDocClassAndSave( featureName, value, config ) {
const pref = config[ featureName ];
const callback = pref.callback || ( () => {} );
clientPrefs.set( featureName, value );
// Client preferences often change the layout of the page significantly, so emit
// a window resize event for other apps that need to update (T374092).
window.dispatchEvent( new Event( 'resize' ) );
callback();
}