-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(FormLayout): split layout logic into distinct classes #8770
Conversation
a19bc1e
to
28b50c8
Compare
d51b5e7
to
22ec06c
Compare
host.style.setProperty('--_max-columns', Math.min(props.maxColumns, maxColumns)); | ||
|
||
host.$.layout.toggleAttribute('fits-labels-aside', this.props.labelsAside && this.__fitsLabelsAside); | ||
host.$.layout.style.setProperty('--_grid-rendered-column-count', this.__renderedColumnCount); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to revert to the previous approach that may trigger an extra style recalculation due to reading getComputedStyle after setting CSS properties. Without this, some tests failed – apparently, they were passing before due to a different order of observers, which was actually not efficient.
* @private | ||
*/ | ||
export class AbstractLayoutController { | ||
constructor(host, config) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be beneficial to add a JSdoc type definition here to help with autocomplete?
Something like:
/**
* @typedef {Object} LayoutControllerConfig
* @property {MutationObserverInit} mutationObserverOptions - Options for the MutationObserver.
*/
/**
* @param {HTMLElement} host
* @param {LayoutControllerConfig} config
*/
constructor(host, config) { ... }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
packages/form-layout/src/layouts/auto-responsive-layout-controller.js
Outdated
Show resolved
Hide resolved
34bcd95
to
fbb5b1d
Compare
fbb5b1d
to
399a2fb
Compare
6b75af6
to
b91c529
Compare
|
Description
Extracts layout logic into distinct classes AutoResponsiveLayout and ResponsiveStepsLayout.
Part of vaadin/platform#7172
Type of change