修复:避免输入框错误

20220420
ChenX 2 years ago
parent 5b7840aa91
commit e7ddf1269f

@ -239,8 +239,8 @@ export class BoardRePosBlock extends React.Component<BroadPosProps> {
}
else if (k === 'count' && this.props.option.boardRelative === BrRelativePos.Div)
{
this.countInputEl.focus();
this.countInputEl.setSelectionRange(0, this.spaceSizeInputEl.value.length);
this.countInputEl?.focus();
this.countInputEl?.setSelectionRange(0, this.spaceSizeInputEl.value.length);
}
};
private handleChangePos = (e) =>
@ -261,8 +261,8 @@ export class BoardRePosBlock extends React.Component<BroadPosProps> {
}
else
{
this.countInputEl.focus();
this.countInputEl.setSelectionRange(0, this.spaceSizeInputEl.value.length);
this.countInputEl?.focus();
this.countInputEl?.setSelectionRange(0, this.spaceSizeInputEl.value.length);
}
}, 0);
};
@ -298,8 +298,7 @@ export class BoardRePosBlock extends React.Component<BroadPosProps> {
{
setTimeout(() =>
{
if (this.countInputEl)
this.countInputEl.focus();
this.countInputEl?.focus();
}, 0);
}
render()

Loading…
Cancel
Save