Opened 7 years ago

Last modified 3 years ago

#15213 open defect

TextBox: does not hold values on "back"

Reported by: Pete Smith Owned by:
Priority: undecided Milestone: 2.0
Component: Dijit - Form Version: 1.7.2
Keywords: Cc: Kitson Kelly
Blocked By: Blocking:

Description (last modified by bill)

Make a regular html form with a regular text input. Touch submit, touch back. The value you typed remains there.

Then put a dijit.form.TextBox or val box and do the same. The dijit widget has "autocomplete=off" on it, and this causes a different behavior on iphone / ipad. I have created my own widget with my own template that doesn't have this, but this is to let people know if they are struggling and hopefully in the future we can lighten the markup delivered on the form widgets.

Attachments (1)

tb.html (982 bytes) - added by bill 6 years ago.
simple test case, fails on chrome too

Download all attachments as: .zip

Change History (9)

comment:1 Changed 7 years ago by bill

Component: GeneralDijit - Form
Owner: set to Douglas Hays

Isn't this true for dijit in general, due to the hidden fields created by MappedTextBox? Maybe a dup of #5424? I think for 2.0 we should get rid of the hidden fields, but that's a big change.

comment:2 Changed 7 years ago by Douglas Hays

Owner: changed from Douglas Hays to bill
Status: newassigned

This isn't related to hidden fields since it fails with TextBox. Even if the TextBox widget did not specify autocomplete, widget::create is not receiving 'value' in params[] on page refresh even though srcNodeRef.value has the old value.

comment:3 Changed 7 years ago by bill

OK. Then probably it's due to TempatedMixin swapping out the original node for the template. Might be able to fix it by putting back the original node on page unload, or some other serialization approach like Editor does with the hidden textarea.

Last edited 7 years ago by bill (previous) (diff)

Changed 6 years ago by bill

Attachment: tb.html added

simple test case, fails on chrome too

comment:4 Changed 6 years ago by bill

Cc: Kitson Kelly added
Description: modified (diff)
Owner: changed from bill to Douglas Hays
Summary: dijit.form.TextBox / ValBox does not hold values on iPad / iPhone "back"TextBox: does not hold values on "back"

I attached a test case.

On back then forward, srcNodeRef.value is "hello" (or whatever the user typed), but srcNodeRef.attributes[] doesn't contain "value", so the parser doesn't pick it up. Doug - Did you assign this to me because you thought it was a parser issue? It doesn't seem like the parser should handle this special case, although I guess it's debatable.

It seems like TextBox should just be checking for srcNodeRef.value, and using it if defined. If a value is also defined in the markup, and/or passed to the constructor, not sure which should take precedence. Perhaps TextBox should have a markupFactory() method that looks at params.value and srcNodeRef.value and decides which to use?

comment:5 Changed 6 years ago by Douglas Hays

Milestone: tbd1.10

comment:6 Changed 5 years ago by Douglas Hays

Milestone: 1.102.0

For 2.0, the non-templated approach for form widgets will preserve values across forward/back.

comment:7 Changed 5 years ago by Douglas Hays

Owner: Douglas Hays deleted
Status: assignedopen
Note: See TracTickets for help on using tickets.