Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ext.form.field.Checkbox.updateIndicator() hides the whole checkbox #1619

Closed
fabriciomurta opened this Issue Dec 20, 2018 · 1 comment

Comments

Projects
None yet
1 participant
@fabriciomurta
Copy link
Contributor

fabriciomurta commented Dec 20, 2018

Found: 4.7.1
Ext.NET forum thread: setFieldLabel on a CheckBox hides it

Whenever a form field's updateIndicator() is called, if no indicator has been set up to the field, the whole checkbox is hidden regardless of its display status. It always hides with the display:none CSS inline rule applied to the indicatorEl.parent() DOM element, which in this situation happens to be the whole checkbox.

Because the checkbox needs special fieldnote handling, it also needed special handling to hide and show the validity indicator, which occured in the related issues #1417, #1567, and #1569.

In the context of this issue report, the checkbox is hid when Ext.net.FieldNote.updateIndicator() is called. This error is issued in core/form/FieldExtensions.js, where it calls this.indicatorEl.parent().setStyle("display", "none");.

This is not a Sencha related issue, as shown by this fiddle:

Ext.application({
    name: 'Fiddle',

    launch: function () {
        var btn1 = Ext.create('Ext.form.field.Checkbox', {
            text: 'Click me',
            handler: function () {

                alert('You clicked the button!');
            }
        });

       Ext.create({
            xtype: 'panel',
            renderTo: Ext.getBody(),
            items: [{xtype: 'checkbox', fieldLabel: 'checkbox'}, {
              xtype: 'button',
              text: 'change label',
              handler: function(){
                  this.up().down('checkbox').setFieldLabel('new cbox');
              }
            }]
        });
    }
});```

@fabriciomurta fabriciomurta added this to the 4.7.2 milestone Dec 20, 2018

@fabriciomurta fabriciomurta self-assigned this Dec 20, 2018

@fabriciomurta

This comment has been minimized.

Copy link
Contributor Author

fabriciomurta commented Feb 19, 2019

The fix makes it smarter when hiding the indicator, so that it does not hide the parent DOM element whenever it is not the expected '-indicator' wrapping div.

@fabriciomurta fabriciomurta modified the milestones: 4.7.2, 4.8.0 Feb 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.