todo: textfield, 但是不是 textarea 而是自定义的输入框
This commit is contained in:
18
client/ui/TextFieldCustom.tsx
Normal file
18
client/ui/TextFieldCustom.tsx
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
import * as React from 'react'
|
||||||
|
import { $, TextField } from "mdui"
|
||||||
|
|
||||||
|
interface Args extends React.HTMLAttributes<TextField & HTMLElement> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function TextFieldCustom({ ...prop }: Args) {
|
||||||
|
// deno-lint-ignore no-explicit-any
|
||||||
|
const textField = React.useRef<any>(null)
|
||||||
|
|
||||||
|
React.useEffect(() => {
|
||||||
|
const shadow = (textField.current as TextField).shadowRoot
|
||||||
|
// $(shadow).find('textarea')
|
||||||
|
})
|
||||||
|
|
||||||
|
return <mdui-text-field {...prop} ref={textField}></mdui-text-field>
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user