Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Commit 71e2dae

Browse files
CaerusKaruThomasBurleson
authored andcommitted
fix(lib): read correct styles during SSR and add test for layout-wrap
* Domino can be stupid about parsing styles on the server, so add an additional inline style read for the property value * Add a test case for nested flex children when parent uses layout wrap. This will be useful when adding SSR testing mode to ensure this case is accounted for in the future
1 parent 1b6101e commit 71e2dae

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/lib/api/flexbox/layout.spec.ts

+7
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,13 @@ describe('layout directive', () => {
167167
});
168168
});
169169

170+
it('should have valid wrap with flex children', () => {
171+
createTestComponent(`<div fxLayout='row wrap'><div fxFlex></div></div>`);
172+
expectNativeEl(fixture).toHaveStyle({
173+
'flex-wrap': 'wrap'
174+
});
175+
});
176+
170177
});
171178

172179
describe('with inline options', () => {

src/lib/utils/style-utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export function lookupAttributeValue(element: HTMLElement, attribute: string): s
7272
* Find the DOM element's inline style value (if any)
7373
*/
7474
export function lookupInlineStyle(element: HTMLElement, styleName: string): string {
75-
return element.style[styleName];
75+
return element.style[styleName] || element.style.getPropertyValue(styleName);
7676
}
7777

7878
/**

0 commit comments

Comments
 (0)