element-plus [Component] [input] Input 在 chrome 和 safari 的表现不一致

mqkwyuun  于 5个月前  发布在  其他
关注(0)|答案(6)|浏览(45)

Bug Type: Component

Environment

  • Vue Version: 3.2.47
  • Element Plus Version: 2.3.4
  • Browser / OS: chrome Version 113.0.5672.92 (Official Build) (arm64)
  • Build Tool: Vite

Reproduction

  • el-input

Element Plus Playground

Steps to reproduce

el-input type 等于 number 时在 chrome 和 safari 表现不一致

What is Expected?

el-input type 等于 number 时在 chrome 和 safari 表现一致

What is actually happening?

el-input type 等于 number 时在 chrome 和 safari 表现不一致

Additional comments

(empty)

o2g1uqev

o2g1uqev1#

这是因为el-input内置的原生input元素,可能你说的是右侧按钮的不同,这跟浏览器自身实现input元素相关,如果你希望统一的样式,可以手动实现右侧按钮和相关特性

k3bvogb1

k3bvogb12#

type 等于 number safari 浏览器还是可以输入其他内容

nue99wik

nue99wik3#

这也是由于各浏览器对input元素的实现细节不同,这方面或许你可以通过检测input事件来实现

rqcrx0a6

rqcrx0a65#

https://element-plus.run/#eyJBcHAudnVlIjoiPHNjcmlwdCBzZXR1cCBsYW5nPVwidHNcIj5cbmltcG9ydCB7IHJlZiwgdmVyc2lvbiBhcyB2dWVWZXJzaW9uIH0gZnJvbSAndnVlJ1xuaW1wb3J0IHsgdmVyc2lvbiBhcyBFcFZlcnNpb24gfSBmcm9tICdlbGVtZW50LXBsdXMnXG5pbXBvcnQgeyBFbGVtZW50UGx1cyB9IGZyb20gJ0BlbGVtZW50LXBsdXMvaWNvbnMtdnVlJ1xuXG5jb25zdCBtc2cgPSByZWYoKVxuY29uc3Qgb25JbnB1dCA9ICh2KSA9PiB7XG4gIGFsZXJ0KHYucmVwbGFjZSgvW14wLTldL2csICcnKSlcbiAgbXNnLnZhbHVlID0gdi5yZXBsYWNlKC9bXjAtOV0vZywgJycpO1xufVxuPC9zY3JpcHQ+XG5cbjx0ZW1wbGF0ZT5cbiAgPGgxPnt7IG1zZyB9fTwvaDE+XG4gIDxlbC1pbnB1dCB2LW1vZGVsPVwibXNnXCIgdHlwZT1cIm51bWJlclwiIEBpbnB1dD1cIm9uSW5wdXRcIiAvPlxuPGlucHV0IHR5cGU9XCJudW1iZXJcIiBtaW49XCIwXCIgaW5wdXRtb2RlPVwibnVtZXJpY1wiIHBhdHRlcm49XCJbMC05XSpcIiB0aXRsZT1cIk5vbi1uZWdhdGl2ZSBpbnRlZ3JhbCBudW1iZXJcIj5cblxuICA8cD5cbiAgICA8ZWwtaWNvbiBjb2xvcj1cInZhcigtLWVsLWNvbG9yLXByaW1hcnkpXCI+PEVsZW1lbnRQbHVzIC8+PC9lbC1pY29uPlxuICAgIEVsZW1lbnQgUGx1cyB7eyBFcFZlcnNpb24gfX0gKyBWdWUge3sgdnVlVmVyc2lvbiB9fVxuICA8L3A+XG48L3RlbXBsYXRlPlxuIiwiaW1wb3J0X21hcC5qc29uIjoie1xuICBcImltcG9ydHNcIjoge31cbn0iLCJfbyI6e319

zazmityj

zazmityj6#

el-input type 等于 number 时在 safari 浏览器不会触发 onInput

相关问题