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

fix: remove check for unsupported type #175

Merged
merged 1 commit into from
May 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/vaadin-checkbox-group.html
Original file line number Diff line number Diff line change
Expand Up @@ -339,17 +339,17 @@

/** @private */
_labelChanged(label) {
this._setOrToggleAttribute('has-label', label === 0 || !!label);
this._setOrToggleAttribute('has-label', !!label);
}

/** @private */
_errorMessageChanged(errorMessage) {
this._setOrToggleAttribute('has-error-message', errorMessage === 0 || !!errorMessage);
this._setOrToggleAttribute('has-error-message', !!errorMessage);
}

/** @private */
_helperTextChanged(helperText) {
this._setOrToggleAttribute('has-helper', helperText === 0 || !!helperText);
this._setOrToggleAttribute('has-helper', !!helperText);
}

/** @private */
Expand Down Expand Up @@ -401,7 +401,7 @@
// The filter is added due to shady DOM triggering this slotchange event on helperText prop change
this._hasSlottedHelper = slottedNodes.filter(node => node.nodeType !== 3).length > 0;

this._setOrToggleAttribute('has-helper', this._hasSlottedHelper ? 'slotted' : this.helperText === 0 || !!this.helperText);
this._setOrToggleAttribute('has-helper', this._hasSlottedHelper ? 'slotted' : !!this.helperText);
}

/** @private */
Expand Down
5 changes: 0 additions & 5 deletions test/vaadin-checkbox-group_test.html
Original file line number Diff line number Diff line change
Expand Up @@ -352,11 +352,6 @@
expect(vaadinCheckboxGroup.hasAttribute('has-helper')).to.be.false;
});

it('setting number helper updates has-helper attribute', function() {
vaadinCheckboxGroup.helperText = 0;
expect(vaadinCheckboxGroup.hasAttribute('has-helper')).to.be.true;
});

it('field with slotted helper updates has-helper attribute', function() {
const checkboxGroupWithSlottedHelper = fixture('default-with-slotted-helper');
checkboxGroupWithSlottedHelper._observer.flush();
Expand Down