File tree Expand file tree Collapse file tree 3 files changed +30
-4
lines changed
fixtures/dom/src/components/fixtures/text-inputs Expand file tree Collapse file tree 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 {
4343 </ p >
4444 </ TestCase >
4545
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+
4674 < TestCase title = "All inputs" description = "General test of all inputs" >
4775 < InputTestCase type = "text" defaultValue = "Text" />
4876 < InputTestCase type = "email" defaultValue = "[email protected] " />
Original file line number Diff line number Diff line change @@ -209,8 +209,7 @@ var ReactDOMInput = {
209209 // browsers typically do this as necessary, jsdom doesn't.
210210 node . value = '' + value ;
211211 }
212- // eslint-disable-next-line
213- } else {
212+ } else if ( node . value !== value ) {
214213 // Cast `value` to a string to ensure the value is set correctly. While
215214 // browsers typically do this as necessary, jsdom doesn't.
216215 node . value = '' + value ;
Original file line number Diff line number Diff line change @@ -201,8 +201,7 @@ var ReactDOMInput = {
201201 // browsers typically do this as necessary, jsdom doesn't.
202202 node . value = '' + value ;
203203 }
204- // eslint-disable-next-line
205- } else {
204+ } else if ( node . value !== value ) {
206205 // Cast `value` to a string to ensure the value is set correctly. While
207206 // browsers typically do this as necessary, jsdom doesn't.
208207 node . value = '' + value ;
You can’t perform that action at this time.
0 commit comments