Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

fix: Dark Mode Button Toggle on Enter Key - #1150

Merged
benhalverson merged 3 commits into
nodejs:masterfrom
manishprivet:dark-mode-button-toggle-fix
Mar 17, 2021
Merged

fix: Dark Mode Button Toggle on Enter Key#1150
benhalverson merged 3 commits into
nodejs:masterfrom
manishprivet:dark-mode-button-toggle-fix

Conversation

@manishprivet

Copy link
Copy Markdown
Member

Description

Added the toggle function to the keyPress event in Dark Mode Button

Related Issues

Fixes #1147

@manishprivet

Copy link
Copy Markdown
Member Author

/preview

@github-actions

Copy link
Copy Markdown

Please find a preview at: https://staging.nodejs.dev/1150/

@rodion-arr rodion-arr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Injecting logic straight into the view seems not really good idea. Wondering if we can reuse existing handler for new event?

Comment thread src/components/Header/index.tsx Outdated
@manishprivet

Copy link
Copy Markdown
Member Author

@rodion-arr I looked for a way if there was one to use the existing handler, but I think it only exists for pointer events.

Also, the npm package that we're using for controlling dark mode, @smotaal.io/dark-mode-controller, I can't find its GitHub repository to look into it more.

@benhalverson

Copy link
Copy Markdown
Member

Hey @SMotaal can you add keypresses to your dark-mode-controller?

@benhalverson benhalverson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, we can refactor later if Saleh replies to my ping.

@benhalverson benhalverson added the create-preview Generate preview on staging.nodejs.dev label Mar 14, 2021
@github-actions github-actions Bot removed the create-preview Generate preview on staging.nodejs.dev label Mar 14, 2021
@github-actions

Copy link
Copy Markdown

Please find a preview at: https://staging.nodejs.dev/1150/

@SMotaal

SMotaal commented Aug 2, 2021

Copy link
Copy Markdown
Contributor

@benhalverson my apologies for going off-grid, refactoring it out per https://github.com/nodejs/nodejs.dev/issues/1177 is the most practical path forward — keep up the good work 🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dark mode toggle button does not work with keyboard events

4 participants