h***@163.com
h***@163.com
  • 发布:2021-07-30 15:17
  • 更新:2021-09-05 00:45
  • 阅读:836

【报Bug】input type为number,selection-start,selection-end不生效

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: win10 1909

HBuilderX类型: 正式

HBuilderX版本号: 3.1.22

手机系统: Android

手机系统版本号: Android 10

手机厂商: 小米

手机机型:

页面类型: vue

打包方式: 云端

项目创建方式: HBuilderX

示例代码:
<input type="text" :value="val" :focus='focus' :selection-start='0' :selection-end='val.length' @focus="input_focus" @blur="input_blur" />  
<input type="number" :value="val2" :focus='focus2' :selection-start='0' :selection-end='val2.length' @focus="input_focus2" @blur="input_blur2" />

type=‘text’时selection-start,selection-end生效
type=‘number’时selection-start,selection-end不生效

操作步骤:
<input type="text" :value="val" :focus='focus' :selection-start='0' :selection-end='val.length' @focus="input_focus" @blur="input_blur" />  
<input type="number" :value="val2" :focus='focus2' :selection-start='0' :selection-end='val2.length' @focus="input_focus2" @blur="input_blur2" />

type=‘text’时selection-start,selection-end生效
type=‘number’时selection-start,selection-end不生效

预期结果:
<input type="text" :value="val" :focus='focus' :selection-start='0' :selection-end='val.length' @focus="input_focus" @blur="input_blur" />  
<input type="number" :value="val2" :focus='focus2' :selection-start='0' :selection-end='val2.length' @focus="input_focus2" @blur="input_blur2" />

type=‘text’时selection-start,selection-end生效
type=‘number’时selection-start,selection-end不生效

实际结果:
<input type="text" :value="val" :focus='focus' :selection-start='0' :selection-end='val.length' @focus="input_focus" @blur="input_blur" />  
<input type="number" :value="val2" :focus='focus2' :selection-start='0' :selection-end='val2.length' @focus="input_focus2" @blur="input_blur2" />

type=‘text’时selection-start,selection-end生效
type=‘number’时selection-start,selection-end不生效

bug描述:

<input type="text" :value="val" :focus='focus' :selection-start='0' :selection-end='val.length' @focus="input_focus" @blur="input_blur" />  
<input type="number" :value="val2" :focus='focus2' :selection-start='0' :selection-end='val2.length' @focus="input_focus2" @blur="input_blur2" />

type=‘text’时selection-start,selection-end生效
type=‘number’时selection-start,selection-end不生效

2021-07-30 15:17 负责人:无 分享
已邀请:
DCloud_UNI_GSQ

DCloud_UNI_GSQ

底层不支持,需要修改为 text 类型

Zzz1012

Zzz1012

nvue好像可以

1***@qq.com

1***@qq.com

尝试用v-model.number 试试?

该问题目前已经被锁定, 无法添加新回复