fix(r2a): fix layout shifting from errors showing as undefined [EE-6570] (#11000)

pull/11002/head
Ali 10 months ago committed by GitHub
parent f7840e0407
commit d5080b6884
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -38,7 +38,16 @@ export function react2angular<T, U extends PropNames<T>[]>(
Component: React.ComponentType<T & JSX.IntrinsicAttributes>,
propNames: U & ([PropNames<T>] extends [U[number]] ? unknown : PropNames<T>)
): IComponentOptions & { name: string } {
const bindings = Object.fromEntries(propNames.map((key) => [key, '<']));
const bindings = Object.fromEntries(
propNames.map((key) => {
// use two way binding for errors, to avoid shifting the layout from errors going between undefined <-> some value when using inputs.
// See https://portainer.atlassian.net/browse/EE-6570 for more context
if (key === 'errors') {
return [key, '='];
}
return [key, '<'];
})
);
return {
bindings,

Loading…
Cancel
Save