mirror of
https://gitee.com/nocobase/nocobase.git
synced 2024-11-30 03:08:31 +08:00
fix(client): clear text formatting when textarea ellipsis
This commit is contained in:
parent
f8dd5d6f79
commit
beb1ea2f9e
@ -34,18 +34,19 @@ ReadPretty.TextArea = (props) => {
|
||||
const prefixCls = usePrefixCls('description-textarea', props);
|
||||
const compile = useCompile();
|
||||
const value = compile(props.value ?? '');
|
||||
const { autop = true } = props;
|
||||
let content = null;
|
||||
const values = HTMLEncode(value).split('\n').join('<br/>');
|
||||
content = (
|
||||
<EllipsisWithTooltip
|
||||
ellipsis={props.ellipsis}
|
||||
popoverContent={autop ? <div dangerouslySetInnerHTML={{ __html: values }} /> : value}
|
||||
>
|
||||
{props.text ?? value}
|
||||
const { autop = true, ellipsis, text } = props;
|
||||
const html = (
|
||||
<div
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: HTMLEncode(value).split('\n').join('<br/>'),
|
||||
}}
|
||||
/>
|
||||
);
|
||||
const content = (
|
||||
<EllipsisWithTooltip ellipsis={ellipsis} popoverContent={autop ? html : value}>
|
||||
{ellipsis ? text || value : html}
|
||||
</EllipsisWithTooltip>
|
||||
);
|
||||
|
||||
return (
|
||||
<div className={cls(prefixCls, props.className)} style={props.style}>
|
||||
{props.addonBefore}
|
||||
|
Loading…
Reference in New Issue
Block a user