mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
Fix the problem of incorrect decimal point input when editbox input type is number (#18118)
Co-authored-by: qiuguohua <guohua.qiu@cocos.com>
This commit is contained in:
@@ -646,7 +646,7 @@ export class EditBoxImpl extends EditBoxImplBase {
|
||||
const delegate = this._delegate;
|
||||
// input of number type doesn't support maxLength attribute
|
||||
const maxLength = delegate!.maxLength;
|
||||
if (maxLength >= 0) {
|
||||
if (maxLength >= 0 && elem.type !== 'number') {
|
||||
elem.value = elem.value.slice(0, maxLength);
|
||||
}
|
||||
delegate!._editBoxTextChanged(elem.value);
|
||||
|
||||
Reference in New Issue
Block a user