Allow focus to move from the search field when there's text in it#1530
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1530 +/- ##
==========================================
- Coverage 81.29% 81.21% -0.09%
==========================================
Files 160 159 -1
Lines 11120 11077 -43
Branches 2746 2736 -10
==========================================
- Hits 9040 8996 -44
Misses 1883 1883
- Partials 197 198 +1
Continue to review full report at Codecov.
|
| className="idleSearchFieldButton" | ||
| onClick={this._onClearButtonClick} | ||
| onFocus={this._onClearButtonFocus} | ||
| tabIndex={-1} |
There was a problem hiding this comment.
Thinking about it more, I don't think we want to avoid to focus it using the keyboard, so we can remove this tabIndex attribute IMO. The previous behavior was really done for the mouse. What do you think?
|
Could we use I think if you're using the keyboard, there's not much need to focus the button anyway; you can just press Ctrl+A and Backspace if you want to clear the field. |
|
I may miss something but this doesn't work for me: http://jsbin.com/jopidicepu/edit?html,css,output |
|
Oh, maybe |
|
I also tried I agree with @mstange that focusing the button is of limited use when using the keyboard. Tabbing to the clear button and then hitting return or space to clear the text seems a bit unnatural. So unless anyone disagrees, I'll keep the tabindex. By the way, if the caret is at the end of the text, one can use Ctrl+U to clear everything in the box directly. It is also a great key combo to use when typing in a password in a terminal when the characters aren't echoed. If you know you typed incorrectly somewhere, you can just hit Ctrl+U and start over :) |
|
well, let's keep the tabindex then |
|
Great, thanks! |
Fixes #1529