ui: fix fileio pretest

This commit is contained in:
undefined committed 2021-10-10 20:08:10 +08:00
1 parent dc4464c19a
commit 603f2938fb
6 files changed
+27 -29

No files matched your search

@@ -13,20 +13,28 @@ export default function DataInputComponent(props) {
const cn = classNames(className, 'flex-col flex-fill');
return (
<div {...rest} className={cn}>
{html // eslint-disable-next-line react/no-danger
? <div className="scratchpad__data-input" wrap="off"><pre dangerouslySetInnerHTML={{ __html: value }} /></div>
: (
<textarea
className="scratchpad__data-input"
wrap="off"
value={value}
onChange={(ev) => {
ev.stopPropagation();
onChange(ev.target.value);
}}
placeholder={title}
/>
)}
{html ? (
<div
className="scratchpad__data-input"
style={{ overflowY: 'scroll' }}
wrap="off"
contentEditable
>
{/* eslint-disable-next-line react/no-danger */}
<pre dangerouslySetInnerHTML={{ __html: value }} />
</div>
) : (
<textarea
className="scratchpad__data-input"
wrap="off"
value={value}
onChange={(ev) => {
ev.stopPropagation();
onChange(ev.target.value);
}}
placeholder={title}
/>
)}
</div>
);
}