Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#11058 closed defect (fixed)

[regression] dijit.form.TextBox - type=hidden, shows a border

Reported by: Pete Smith Owned by: Douglas Hays
Priority: high Milestone: 1.5
Component: Dijit - Form Version: 1.5.0b1
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

I see the css has been overhauled. I have :

new dijit.form.TextBox({name: this.name, type: 'hidden', value: this.value});

Which shows up with a gray border on it. This is coming from Common.css on line 22. Hidden should auto apply a hidden class should it not?

This did not do this in 1.4.X.

Attachments (3)

dijitFormRegression.html (1.6 KB) - added by Kitson Kelly 10 years ago.
Provides an example of a form where the hidden field gets rendered.
_FormWidget.js.patch (470 bytes) - added by Kitson Kelly 10 years ago.
Does a dojo.style(this.domNode,"display","none") when the type="hidden"
11058_css.patch (1.0 KB) - added by Douglas Hays 10 years ago.
CSS only solution for comparison to enable custom styling based on type

Download all attachments as: .zip

Change History (11)

comment:1 Changed 10 years ago by bill

Description: modified (diff)
Milestone: tbd1.5
Owner: set to Douglas Hays
Summary: dijit.form.TextBox - type=hidden, shows a border[regression] dijit.form.TextBox - type=hidden, shows a border

Maybe from [21560]?

comment:2 Changed 10 years ago by Kitson Kelly

I am experiencing this too... I have attached an example attached that demonstrates this. I get the following in the rendered HTML for the field:

In 1.4:

<input type="hidden" name="postAction" autocomplete="off" dojoattachevent="onmouseenter:_onMouse,onmouseleave:_onMouse" dojoattachpoint="textbox,focusNode" class="dijit dijitReset dijitLeft dijitTextBox" value="search" id="dijit_form_TextBox_0" tabindex="0" widgetid="dijit_form_TextBox_0">

In 1.5.0b2:

<div wairole="presentation" id="widget_dijit_form_TextBox_0" class="dijit dijitReset dijitInline dijitLeft dijitTextBox" role="presentation" dir="ltr" widgetid="dijit_form_TextBox_0"><div class="dijitReset dijitInputField dijitInputContainer"><input type="hidden" name="postAction" autocomplete="off" dojoattachpoint="textbox,focusNode" class="dijitReset dijitInputInner" value="search" id="dijit_form_TextBox_0" tabindex="0"></div></div>

Changed 10 years ago by Kitson Kelly

Attachment: dijitFormRegression.html added

Provides an example of a form where the hidden field gets rendered.

comment:3 Changed 10 years ago by Kitson Kelly

I took a look at the code, and it does seem to be related to [21560], because prior to it, the TextBox? template simply had a <input> tag and now it has the two <div> that wrap the <input>.

Personally, I would submit a patch, but I am not sure how it should be fixed.

My suggestion would be to fix it more fundamentally at the dijit.form._FormWidget to apply a dojo.style to the .domNode whenever the type="hidden", but I don't know enough to say if that would break anything else.

comment:3 Changed 10 years ago by Douglas Hays

Status: newassigned

comment:4 Changed 10 years ago by Kitson Kelly

I did a quick fix based on my suggestion above and have supplied a patch. It seems to work for me in several different scenarios and doesn't have any ill affects with other Widgets.

My CCLA has been on file from 28 April with Aimee.

Changed 10 years ago by Kitson Kelly

Attachment: _FormWidget.js.patch added

Does a dojo.style(this.domNode,"display","none") when the type="hidden"

Changed 10 years ago by Douglas Hays

Attachment: 11058_css.patch added

CSS only solution for comparison to enable custom styling based on type

comment:5 Changed 10 years ago by Douglas Hays

I attached an alternate non-javascript patch (textbox subclasses would need the new class added as well) for Bill to choose from.

comment:7 Changed 10 years ago by Douglas Hays

Resolution: fixed
Status: assignedclosed

(In [22145]) Fixes #11049, #11058. For TextBox? widgets of type file|hidden, swap the multi-node template for a single INPUT version since styling capabilities are only minimally required/allowed. Added the ability to select the single node template (for backward compatibility) by setting templateString="input".

comment:8 Changed 9 years ago by bill

Component: DijitDijit - Form
Note: See TracTickets for help on using tickets.