Closed
Bug 1352799
Opened 6 years ago
Closed 6 years ago
dynamic maxlength in input form didn't work
Categories
(Core :: DOM: Editor, defect, P3)
Tracking
()
RESOLVED
FIXED
mozilla55
People
(Reporter: h_enzi, Assigned: m_kato)
References
()
Details
(Keywords: dev-doc-complete, testcase)
Attachments
(2 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0 Build ID: 20170323105023 Steps to reproduce: i changed the value of input's maxlength dynamically using javascript Actual results: the value of maxlength did changed, for example from maxlength='2' to maxlength='4' (i checked it via inspect element) Expected results: i can't type more than 2 character when the maxlength value is changed to 4
Reporter | ||
Comment 1•6 years ago
|
||
forgot to mention, it works when i changed the value of maxlength to 0, then change it again using setTimeout
Could you attach a minimal testcase, please.
Flags: needinfo?(h_enzi)
Keywords: testcase-wanted
Comment 3•6 years ago
|
||
[Tracking Requested - why for this release]: Need more info with atleast minimum test case to reproduce futher h_enzi@yahoo.co.id? [bugday-20170403]
tracking-firefox52:
--- → ?
Comment 4•6 years ago
|
||
Need more information from the user to reproduce it further [bugday-20170403]
Comment 5•6 years ago
|
||
Too late for 52, and it doesn't sound like this is in a state where it can be tracked for future releases.
Comment 6•6 years ago
|
||
I can confirm this one, please see: https://jsfiddle.net/n44cbhgd/1/ steps to reproduce: - click b1 - input: "12" into the textbox - click b2 - click b3 - input something into the textbox, it should be 4 char max but we can't input more than 2 thanks
Comment 7•6 years ago
|
||
sorry the URL should be: https://jsfiddle.net/n44cbhgd/1/
Comment 8•6 years ago
|
||
sorry the URL should be: https://jsfiddle.net/n44cbhgd/2/
Old FF33 has the bug too.
Keywords: testcase-wanted → testcase
Assignee | ||
Comment 10•6 years ago
|
||
nsTextControlFrame sets SetMaxTextLLength to editor, but due to display = none, RestyleManager doesn't call nsTextControlFrame::AttributeChanged. So we should move calling SetMaxTextLength to HTMLInputElement or nsTextEditorState
Assignee | ||
Updated•6 years ago
|
Assignee: nobody → m_kato
Priority: -- → P3
Assignee | ||
Updated•6 years ago
|
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment 13•6 years ago
|
||
mozreview-review |
Comment on attachment 8860841 [details] Bug 1352799 - Part 2. Add test for changing maxlength dynamically. https://reviewboard.mozilla.org/r/132834/#review135692 ::: editor/libeditor/tests/test_bug1352799.html:60 (Diff revision 1) > + window.setTimeout(() => { > + input.removeAttribute('maxlength'); > + inputcontainer.style.display = 'block'; > + > + input.focus(); > + > + synthesizeKey('1', {}); > + synthesizeKey('2', {}); > + synthesizeKey('3', {}); > + synthesizeKey('4', {}); > + synthesizeKey('5', {}); > + synthesizeKey('6', {}); > + synthesizeKey('7', {}); > + synthesizeKey('8', {}); > + > + is(input.value, '12345678', 'value should be 12345678 without maxlength'); > + > + SimpleTest.finish(); Could you add a test which sets smaller number to maxlength. Then, I guess that the value should be truncated. If you'd need to change the behavior for compatibility with other browsers, it'd be okay to use todo_is().
Attachment #8860841 -
Flags: review?(masayuki) → review+
Comment 14•6 years ago
|
||
mozreview-review |
Comment on attachment 8860840 [details] Bug 1352799 - Always set maxlength on initializing editor. https://reviewboard.mozilla.org/r/132832/#review135694
Attachment #8860840 -
Flags: review?(masayuki) → review+
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment 18•6 years ago
|
||
Pushed by m_kato@ga2.so-net.ne.jp: https://hg.mozilla.org/integration/autoland/rev/45f61d7420ec Always set maxlength on initializing editor. r=masayuki https://hg.mozilla.org/integration/autoland/rev/d309a5a0a165 Part 2. Add test for changing maxlength dynamically. r=masayuki
Comment 19•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/45f61d7420ec https://hg.mozilla.org/mozilla-central/rev/d309a5a0a165
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
status-firefox55:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Comment 20•6 years ago
|
||
*Might* be better to be in "Firefox 55 for Developers", but up to writers.
Comment 21•6 years ago
|
||
I've added a note to the Fx55 release notes to cover this; see the bottom of: https://developer.mozilla.org/en-US/Firefox/Releases/55#DOM_HTML_DOM Let me know if you think the wording is OK. Thanks!
Keywords: dev-doc-needed → dev-doc-complete
Comment 22•6 years ago
|
||
(In reply to Chris Mills (Mozilla, MDN editor) [:cmills] from comment #21) > I've added a note to the Fx55 release notes to cover this; see the bottom of: > > https://developer.mozilla.org/en-US/Firefox/Releases/55#DOM_HTML_DOM > > Let me know if you think the wording is OK. Thanks! Thanks, looks fine to me.
You need to log in
before you can comment on or make changes to this bug.
Description
•