-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
fix: move caret even with clear backspace #2066
fix: move caret even with clear backspace #2066
Conversation
Hmmm -- It's a shame there's no cross browser/cross platform keystroke we can use for this instead of setSelectionRange |
@session.execute_script("var el = document.getElementById('test_field'); el.focus(); el.setSelectionRange(0, 0);") | ||
@session.first('//input').set('') | ||
expect(@session.first('//input').value).to eq('') | ||
|
||
@session.first('//input').set('monkey') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test can't go here. The clear: :backspace
behavior is Selenium specific so the test needs to go in spec/shared_selenium_session.rb
with the other tests for that behavior
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, I'll move the test tomorrow. Appart from that, are you ok with the PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at it more -- it appears the issue is Chrome specific -- wondering whether it's worth fixing it only in chrome_node.rb - I am curious why it only affects Chrome though since it seems like setting the caret to the beginning should affect FF too, and as I implied in my other comment I'd really prefer some way of doing this that doesn't depend on checking the element type and using setSelectionRange if possible.
Changing set_text to do |
If using |
|
@cyrilchampier I don't really understand why sending :end actually works, but if it works on mac and travis I'm fine considering it ok. Please remove the extraneous |
@cyrilchampier Do you have time to make the requested cleanup here so I can get this merged? If not I'll go ahead and make the changes tomorrow. |
sorry, i am in holidays until wednesday.
i will not be able to check that until then.
…On Sun, Jul 15, 2018, 18:41 Thomas Walpole ***@***.***> wrote:
@cyrilchampier <https://github.com/cyrilchampier> Do you have time to
make the requested cleanup here so I can get this merged? If not I'll go
ahead and make the changes tomorrow.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2066 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACB6rDh5g4CrBW9LAcgUNGbITiWQQaWZks5uG3DIgaJpZM4VJJT5>
.
|
tx, I was getting married this week end, a bit busy ;) |
Congratulations! |
No description provided.