Skip to content
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

feat: Support percentage height for ui.form components #326 #2004

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion ui/src/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -258,14 +258,20 @@ export const
alignSelf = componentKey === 'links' ? 'flex-start' : undefined

if (m[componentKey].width !== width) m[componentKey].width = width
if (height?.endsWith('%')) m[componentKey].height = '100%'

return (
<div
// Recreate only if name or position within form items changed, update otherwise.
key={name || `${componentKey}-${i}`}
data-visible={visible}
className={height === '1' ? css.fullHeight : ''}
style={{ ...visibleStyles, width, alignSelf }}
style={{
...visibleStyles,
width,
minHeight: height === '1' ? undefined : height,
alignSelf
}}
>
<XComponent model={m} />
</div>
Expand Down
8 changes: 6 additions & 2 deletions ui/src/tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ const
container: {
display: 'flex',
alignItems: 'flex-start',
alignContent: 'flex-start'
alignContent: 'flex-start',
height: '100%'
},
expand: {
flexGrow: 1
Expand All @@ -40,6 +41,9 @@ const
},
preventOverflow: {
minWidth: 0
},
tooltipWrapper: {
height: 'inherit'
}
})

Expand All @@ -59,7 +63,7 @@ export const
showIcon
? (
<>
<div className={clas(css.preventOverflow, expand ? css.expand : '')}>{children}</div>
<div className={clas(css.preventOverflow, css.tooltipWrapper, expand ? css.expand : '')}>{children}</div>
<Fluent.TooltipHost tooltipProps={tooltipProps}>
<Fluent.FontIcon className={css.icon} iconName='Info' />
</Fluent.TooltipHost>
Expand Down