mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
ui: fix fileio pretest
This commit is contained in:
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>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user