我正在构建一个组件NumberField,它将在单击(onFocus)时删除0,允许用户从空字段中输入数字,并在焦点离开(onBlur)和字段为空时返回0。当onBlur被触发时,我想从属性中调用onChange函数。import * as React from 'react'
TextField,} from '@material-ui/cor
HMTL: <TextField text="the cursor should point at the end when clicked" (focus)="onFocus($event.object)"> </TextField> TS: public onFocus(textfield): void {
textfield.android.setSelection(textfield.text.length