Skip to content

Commit

Permalink
Apply additional props to checkbox/switch inputs rather than wrappers (
Browse files Browse the repository at this point in the history
…#246)

Apply additional props to checkbox/switch inputs rather than wrappers
  • Loading branch information
snide authored Jan 2, 2018
1 parent f7070ee commit 9765340
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ No public interface changes since `0.0.10`.

- Fix bug in `Pager` service which occurred when there were no items. [(#237)[https://github.com/elastic/eui/pull/237]]
- Add `isPageable` method to `Pager` service and set first and last page index to -1 when there are no pages. [(#242)[https://github.com/elastic/eui/pull/242]]
- Apply additional props to checkbox/switch inputs rather than wrappers. [(#246)](https://github.com/elastic/eui/pull/246)

# [`0.0.9`](https://github.com/elastic/eui/tree/v0.0.9)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

exports[`EuiCheckbox is rendered 1`] = `
<div
aria-label="aria-label"
class="euiCheckbox testClass1 testClass2"
data-test-subj="test subject string"
>
<input
aria-label="aria-label"
class="euiCheckbox__input"
data-test-subj="test subject string"
id="id"
type="checkbox"
/>
Expand Down
2 changes: 1 addition & 1 deletion src/components/form/checkbox/checkbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export const EuiCheckbox = ({
return (
<div
className={classes}
{...rest}
>
<input
className="euiCheckbox__input"
Expand All @@ -49,6 +48,7 @@ export const EuiCheckbox = ({
checked={checked}
onChange={onChange}
disabled={disabled}
{...rest}
/>

<div className="euiCheckbox__square">
Expand Down
4 changes: 2 additions & 2 deletions src/components/form/switch/__snapshots__/switch.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

exports[`EuiSwitch is rendered 1`] = `
<div
aria-label="aria-label"
class="euiSwitch testClass1 testClass2"
data-test-subj="test subject string"
>
<input
aria-label="aria-label"
class="euiSwitch__input"
data-test-subj="test subject string"
type="checkbox"
/>
<span
Expand Down
3 changes: 2 additions & 1 deletion src/components/form/switch/switch.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const EuiSwitch = ({
const classes = classNames('euiSwitch', className);

return (
<div className={classes} {...rest}>
<div className={classes}>
<input
className="euiSwitch__input"
name={name}
Expand All @@ -26,6 +26,7 @@ export const EuiSwitch = ({
checked={checked}
disabled={disabled}
onChange={onChange}
{...rest}
/>

<span className="euiSwitch__body">
Expand Down

0 comments on commit 9765340

Please sign in to comment.