Skip to content

Commit

Permalink
Fix comment suggestions.
Browse files Browse the repository at this point in the history
  • Loading branch information
DiegoCardoso committed May 28, 2020
1 parent c43dbe6 commit 7433577
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions demo/checkbox-basic-demos.html
Expand Up @@ -47,16 +47,16 @@ <h3>Disabled state</h3>

<h3>Helper text</h3>
<p>Use the <code>helper-text</code> attribute or add content to the <code>helper</code> slot to set helper content.</p>
<vaadin-demo-snippet id="text-field-basic-demos-helper-text">
<vaadin-demo-snippet id="basic-demos-helper-text">
<template preserve-content>
<vaadin-checkbox-group label="Helper text" theme="vertical"
helper-text="Pick on option">
<vaadin-checkbox-group label="Label" theme="vertical"
helper-text="Pick on option">
<vaadin-checkbox value="1">Option one</vaadin-checkbox>
<vaadin-checkbox value="2">Option two</vaadin-checkbox>
<vaadin-checkbox value="3">Option three</vaadin-checkbox>
</vaadin-checkbox-group>

<vaadin-checkbox-group label="Helper text" theme="vertical">
<vaadin-checkbox-group label="Label" theme="vertical">
<span slot="helper">Pick one option</span>
<vaadin-checkbox value="1">Option one</vaadin-checkbox>
<vaadin-checkbox value="2">Option two</vaadin-checkbox>
Expand Down
6 changes: 3 additions & 3 deletions demo/checkbox-theme-variants-demos.html
Expand Up @@ -25,17 +25,17 @@ <h4>Vertical</h4>
</vaadin-demo-snippet>

<h3>Helper text position</h3>
<vaadin-demo-snippet id="text-field-theme-demos-sizes">
<vaadin-demo-snippet id="theme-demos-helper-text-position">
<template preserve-content>
<h4>Below</h4>
<vaadin-checkbox-group label="Label" helper-text="Helper text below text field">
<vaadin-checkbox-group label="Label" helper-text="Helper text below">
<vaadin-checkbox value="1" checked>Option one</vaadin-checkbox>
<vaadin-checkbox value="2">Option two</vaadin-checkbox>
<vaadin-checkbox value="3">Option three</vaadin-checkbox>
</vaadin-checkbox-group>

<h4>Above</h4>
<vaadin-checkbox-group label="Label" helper-text="Helper text above text field" theme="helper-above-field">
<vaadin-checkbox-group label="Label" helper-text="Helper text above" theme="helper-above-field">
<vaadin-checkbox value="1" checked>Option one</vaadin-checkbox>
<vaadin-checkbox value="2">Option two</vaadin-checkbox>
<vaadin-checkbox value="3">Option three</vaadin-checkbox>
Expand Down
2 changes: 1 addition & 1 deletion src/vaadin-checkbox-group.html
Expand Up @@ -399,7 +399,7 @@
// Only has slotted helper if not a text node
// Text nodes are added by the helperText prop and not the helper slot
// 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;
this._hasSlottedHelper = slottedNodes.filter(node => node.nodeType !== 3).length > 0;

this._setOrToggleAttribute('has-helper', this._hasSlottedHelper ? 'slotted' : this.helperText === 0 || !!this.helperText);
}
Expand Down
2 changes: 1 addition & 1 deletion test/vaadin-checkbox-group_test.html
Expand Up @@ -357,7 +357,7 @@
expect(vaadinCheckboxGroup.hasAttribute('has-helper')).to.be.true;
});

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

0 comments on commit 7433577

Please sign in to comment.