#15541 closed defect (invalid)
dijit.form.Button display:none to display:inline doesn't work.
Reported by: | charly | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | tbd |
Component: | Dijit - Form | Version: | 1.7.2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Hello,
I have created a dijit.form.button with style display none, like this
<input type="button" style="display: none" id="saveButton" data-dojo-type="dijit.form.Button" data-dojo-props="label:'Save', iconClass:'dijitEditorIcon dijitEditorIconSave', showLabel:'true'" />
Later I have changed the display to inline, like this
dijit.byId('saveButton').set('style','display:inline');
HTML output:
<span role="presentation" class="dijit dijitReset dijitInline dijitButton" style="display: inline;" widgetid="saveButtonUpdateWithTransfer"> <span role="presentation" data-dojo-attach-event="ondijitclick:_onClick" class="dijitReset dijitInline dijitButtonNode"> <span aria-labelledby="saveButtonUpdateWithTransfer_label" role="button" data-dojo-attach-point="titleNode,focusNode" class="dijitReset dijitStretch dijitButtonContents" tabindex="0" id="saveButtonUpdateWithTransfer" style="-moz-user-select: none; display: none;"> <span data-dojo-attach-point="iconNode" class="dijitReset dijitInline dijitIcon dijitEditorIcon dijitEditorIconSave"></span> <span class="dijitReset dijitToggleButtonIconChar">●</span> <span data-dojo-attach-point="containerNode" id="saveButtonUpdateWithTransfer_label" class="dijitReset dijitInline dijitButtonText">Save and Close with transfer</span> </span> </span> <input type="button" data-dojo-attach-point="valueNode" role="presentation" tabindex="-1" class="dijitOffScreen" value=""></span>
Problem: I don't see the label, because the display style is none.
Workaround:
dijit.byId('saveButton').set('style','display:inline'); dojo.style("saveButton", "display", "inline");
thx
Change History (2)
comment:1 Changed 9 years ago by
Component: | General → Dijit - Form |
---|---|
Resolution: | → invalid |
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
Well, depending on the browser, Button is display:inline-block, not display:inline, so you are setting display to an invalid value.
I'd suggest that instead of modifying style, you add/remove a "hidden" class (or use the "dijitHidden" class).