File tree 3 files changed +30
-4
lines changed
fixtures/dom/src/components/fixtures/text-inputs
3 files changed +30
-4
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,34 @@ class TextInputFixtures extends React.Component {
43
43
</ p >
44
44
</ TestCase >
45
45
46
+ < TestCase title = "Cursor when editing email inputs" >
47
+ < TestCase . Steps >
48
+
49
+ < li > Select "@"</ li >
50
+ < li > Type ".", to replace "@" with a period</ li >
51
+ </ TestCase . Steps >
52
+
53
+ < TestCase . ExpectedResult >
54
+ The text field's cursor should not jump to the end.
55
+ </ TestCase . ExpectedResult >
56
+
57
+ < InputTestCase type = "email" defaultValue = "" />
58
+ </ TestCase >
59
+
60
+ < TestCase title = "Cursor when editing url inputs" >
61
+ < TestCase . Steps >
62
+ < li > Type "http://www.example.com"</ li >
63
+ < li > Select "www."</ li >
64
+ < li > Press backspace/delete</ li >
65
+ </ TestCase . Steps >
66
+
67
+ < TestCase . ExpectedResult >
68
+ The text field's cursor should not jump to the end.
69
+ </ TestCase . ExpectedResult >
70
+
71
+ < InputTestCase type = "url" defaultValue = "" />
72
+ </ TestCase >
73
+
46
74
< TestCase title = "All inputs" description = "General test of all inputs" >
47
75
< InputTestCase type = "text" defaultValue = "Text" />
48
76
< InputTestCase type = "email" defaultValue = "[email protected] " />
Original file line number Diff line number Diff line change @@ -209,8 +209,7 @@ var ReactDOMInput = {
209
209
// browsers typically do this as necessary, jsdom doesn't.
210
210
node . value = '' + value ;
211
211
}
212
- // eslint-disable-next-line
213
- } else {
212
+ } else if ( node . value !== value ) {
214
213
// Cast `value` to a string to ensure the value is set correctly. While
215
214
// browsers typically do this as necessary, jsdom doesn't.
216
215
node . value = '' + value ;
Original file line number Diff line number Diff line change @@ -201,8 +201,7 @@ var ReactDOMInput = {
201
201
// browsers typically do this as necessary, jsdom doesn't.
202
202
node . value = '' + value ;
203
203
}
204
- // eslint-disable-next-line
205
- } else {
204
+ } else if ( node . value !== value ) {
206
205
// Cast `value` to a string to ensure the value is set correctly. While
207
206
// browsers typically do this as necessary, jsdom doesn't.
208
207
node . value = '' + value ;
You can’t perform that action at this time.
0 commit comments