Skip to content

Commit

Permalink
Use addEventListener instead of addListener
Browse files Browse the repository at this point in the history
  • Loading branch information
EtienneLem committed Jan 6, 2024
1 parent 96eb041 commit 17553dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/emoji-mart/src/components/Picker/Picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export default class Picker extends Component {

unregister() {
document.removeEventListener('click', this.handleClickOutside)
this.darkMedia?.removeListener(this.darkMediaCallback)
this.darkMedia?.removeEventListener('change', this.darkMediaCallback)
this.unobserve()
}

Expand Down Expand Up @@ -207,7 +207,7 @@ export default class Picker extends Component {
this.darkMedia = matchMedia('(prefers-color-scheme: dark)')
if (this.darkMedia.media.match(/^not/)) return 'light'

this.darkMedia.addListener(this.darkMediaCallback)
this.darkMedia.addEventListener('change', this.darkMediaCallback)
}

return this.darkMedia.matches ? 'dark' : 'light'
Expand Down

0 comments on commit 17553dc

Please sign in to comment.