Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TextBox 文本全选有猫腻 #507

Open
yibuyisheng opened this issue Aug 18, 2015 · 4 comments
Open

TextBox 文本全选有猫腻 #507

yibuyisheng opened this issue Aug 18, 2015 · 4 comments

Comments

@yibuyisheng
Copy link
Member

TextBox 在设置了 autoSelect 为 true 之后,无法正确获取焦点后全选文本,测试浏览器为:

safari
chrome
firefox

具体表现可参见:http://yibuyisheng.github.io/esui-demo/demo/TextBox.html

@Justineo
Copy link
Member

似乎不是 ESUI 本身的问题,看了下有两个解决方法:http://jsbin.com/zetokayuqo/edit?html,js,output

@yankun01
Copy link
Contributor

            if (this.autoSelect) {
                var input = lib.g(this.inputId);
                input.select();
            }
```js end
好像是这么做的。 我试了一下是好的。是不是我没有理解这个问题。

@yibuyisheng
Copy link
Member Author

@yankun01 你那边在浏览器里面看过这个 demo 了吗?

@chestnutchen
Copy link
Member

mousedown之后会触发focus,然后在mouseup之后渲染光标位置,相当于unselect了,应该是这个问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants