element-plus / element-plus

🎉 A Vue.js 3 UI Library made by Element team
https://element-plus.org
MIT License
24.4k stars 16.36k forks source link

[Component] [input] Input 输入框密码框使用 show-password 属性切换显示隐藏的密码框,光标会移到第一位 #18387

Open junyoua opened 3 weeks ago

junyoua commented 3 weeks ago

Bug Type: Component

Environment

Reproduction

Related Component

Reproduction Link

Docs

Steps to reproduce

Input 输入框密码框使用 show-password 属性切换显示隐藏的密码框,光标会移到第一位

What is Expected?

光标在最后一位

What is actually happening?

光标在第一位

Additional comments

(empty)

warmthsea commented 3 weeks ago

It seems to be a problem starting from version 2.8.0

tuskermanshu commented 3 weeks ago

As a result of this PR #17362

limoonrise commented 3 weeks ago

image

切换的时候先blur后聚焦就行了。我看源码上有相关的问题修改,加了个 await nextTick。不晓得为啥现在没有效果。