Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added is-focus-mode class on all viewports. #67377

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

yogeshbhutkar
Copy link
Contributor

@yogeshbhutkar yogeshbhutkar commented Nov 28, 2024

Fixes: #67376

What?

This pull request addresses and resolves the issue where Spotlight Mode does not function as intended on mobile viewports. The fix ensures that the feature behaves consistently across all devices, aligning the mobile experience with the expected functionality seen on desktop. By implementing this solution, users will now observe the proper highlighting of the active block with reduced opacity for surrounding elements.

Why?

This fix is crucial as displaying the Spotlight Mode toggle on mobile viewports without any associated functionality can mislead users into believing the toggle is broken. To address this, two solutions were proposed in the issue description:

  1. Remove the toggle entirely from mobile viewports.
  2. Enable the functionality for mobile viewports.

This PR adopts and enables the functionality of Spotlight Mode on mobile devices.

How?

'is-focus-mode': isFocusMode && isLargeViewport,

The code above previously prevented the is-focus-mode class from being applied to viewports with smaller widths, resulting in the observed bug. The additional viewport restrictions were removed to resolve this issue, ensuring consistent functionality across all viewport sizes.

Screencast

Screen.Recording.2024-11-28.at.2.53.19.PM.mov

@yogeshbhutkar yogeshbhutkar marked this pull request as ready for review November 28, 2024 09:25
Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: yogeshbhutkar <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@ellatrix ellatrix added the [Type] Bug An existing feature does not function as intended label Dec 19, 2024
Copy link
Member

@ellatrix ellatrix left a comment

Choose a reason for hiding this comment

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

Makes sense.

@ellatrix ellatrix merged commit 030c680 into WordPress:trunk Dec 19, 2024
66 of 69 checks passed
@github-actions github-actions bot added this to the Gutenberg 20.0 milestone Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Spotlight Mode does not work as expected in mobile viewports
2 participants