Added support for multi line descriptions in self serve framework (#1266)

* Added support for multi line descriptions

* test snapshot change

* addresse pr comments
This commit is contained in:
Srinath Narayanan
2022-05-06 00:01:06 +05:30
committed by GitHub
parent 9cb4632f32
commit fcfc52a80c
4 changed files with 21 additions and 2 deletions

View File

@@ -181,7 +181,7 @@ export class SmartUiComponent extends React.Component<SmartUiComponentProps, Sma
const descriptionElement = (
<Stack>
{labelElement}
<Text id={`${dataFieldName}-text-display`} aria-labelledby={labelId}>
<Text id={`${dataFieldName}-text-display`} aria-labelledby={labelId} style={{ whiteSpace: "pre-line" }}>
{this.props.getTranslation(description.textTKey)}{" "}
{description.link && (
<Link target="_blank" href={description.link.href}>

View File

@@ -27,6 +27,11 @@ exports[`SmartUiComponent disable all inputs 1`] = `
<Text
aria-labelledby="description-label"
id="description-text-display"
style={
Object {
"whiteSpace": "pre-line",
}
}
>
this is an example description text.
@@ -341,6 +346,11 @@ exports[`SmartUiComponent should render and honor input's hidden, disabled state
<Text
aria-labelledby="description-label"
id="description-text-display"
style={
Object {
"whiteSpace": "pre-line",
}
}
>
this is an example description text.