Skip to content

Commit

Permalink
feat: create toggle component (devhatt#77)
Browse files Browse the repository at this point in the history
* feat: Implement toggle component adhering to Material Design with animated switch and external event listeners

fix devhatt#71

* feat: Implement toggle component adhering to Material Design with animated switch and external event listeners

fix devhatt#71

* Made some adjustments according to reviews

* Write modifiers according to BEM

* Adjust Toggle function

* Solved conflicts

* Make adjustments according to reviews

* Made adjustments according to reviews, changed scss file structure

* Create setToggle function

* Adjust scss and setToggle method structure
  • Loading branch information
nathalia-84 authored and DominMFD committed Mar 27, 2024
1 parent 1f04d54 commit 9916dba
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/components/Toggle/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, createIDFactory } from 'pet-dex-utilities';
import './index.scss';
import { Component, createIDFactory } from 'pet-dex-utilities';

const generateID = createIDFactory('toggle');

Expand All @@ -21,9 +21,7 @@ export default function Toggle({ checked = false } = {}) {

this.setToggle(checked, false);

this.selected
.get('toggle-input')
.addEventListener('change', () => this.emitToggle());
this.selected.get('toggle-input').addEventListener('change', () => this.emitToggle());
}

Toggle.prototype = Object.assign(Toggle.prototype, Component.prototype, {
Expand Down

0 comments on commit 9916dba

Please sign in to comment.