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

Issue with Sensei Image Hotspot blocks #1976

Open
westnz opened this issue Nov 12, 2023 · 3 comments
Open

Issue with Sensei Image Hotspot blocks #1976

westnz opened this issue Nov 12, 2023 · 3 comments
Labels
[Type] Bug Something isn't working on the Learn website.

Comments

@westnz
Copy link
Collaborator

westnz commented Nov 12, 2023

Description

When editing specific lessons in a course, I encounter an issue where certain blocks do not display correctly in the backend, accompanied by the message: 'This block contains unexpected or invalid content.'

Step-by-step reproduction instructions

Please list the steps needed to reproduce the bug. For example:

  1. Go to https://learn.wordpress.org/wp-admin/post.php?post=32842&action=edit
  2. Scroll down to the examples where image hotspots have been used.

Please note, this is only one example but also happens with other blocks such as Flashcard block: https://learn.wordpress.org/wp-admin/post.php?post=32844&action=edit & even the Video block: https://learn.wordpress.org/wp-admin/post.php?post=12045&action=edit

Expected behaviour

The blocks appear correctly.

Actual behaviour

The block needs to be recovered and you see the message: 'This block contains unexpected or invalid content.' You can recover the block, but it appears incorrectly again when you refresh or return to the lesson at a later stage.

Screenshots or screen recording (optional)

image image image

Environment information

  • Browser(s) are you seeing the problem on: Chrome
  • Device you are using: Macbook Pro
@westnz westnz added [Type] Bug Something isn't working on the Learn website. Awaiting Triage Issues awaiting triage. See Training Team handbook for how to triage issues. labels Nov 12, 2023
@github-project-automation github-project-automation bot moved this to 👋 Ready to Create in LearnWP Content - Development Nov 12, 2023
@jonathanbossenger
Copy link
Collaborator

Thanks for logging @westnz. To debug and replicate the issue, we need a link to an existing lesson where this is happening. Are you able to share such a link?

@westnz
Copy link
Collaborator Author

westnz commented Nov 13, 2023

Ah, I did originally fill in the reproduction steps. Fixed! ⏫

@jonathanbossenger
Copy link
Collaborator

Thanks @westnz, I have also been able to replicate this on a test lesson

https://learn.wordpress.org/wp-admin/post.php?post=50087&action=edit

@adamwoodnz After looking into this, it looks like the Sensei image hotspot block sets a tabindex of -1 to the a tag used inside the image hotspot block, and somewhere along the line, this tabindex is removed.

Content generated by `save` function:

<div class="wp-block-sensei-pro-image-hotspots-hotspot" data-sensei-block-id="efad44b7-2ecc-4942-8316-b68f62cbe2e2" data-sensei-wp-block="{&quot;blockId&quot;:&quot;efad44b7-2ecc-4942-8316-b68f62cbe2e2&quot;,&quot;draft&quot;:false,&quot;x&quot;:55.53571428571429,&quot;y&quot;:24.136904761904763}"><button class="sensei-lms-image-hotspots__hotspot-marker" style="left:55.53571428571429%;top:24.136904761904763%"><a tabindex="-1"></a></button><div class="sensei-lms-image-hotspots__hotspot-tooltip wp-block-sensei-pro-image-hotspots-hotspot" style="--y:24.14%;--x:55.54%"><span class="sensei-lms-image-hotspots__hotspot-tooltip-arrow"></span><!--sensei:inner-blocks-->

<!--/sensei:inner-blocks--></div></div>
Content retrieved from post body:

<div class="wp-block-sensei-pro-image-hotspots-hotspot" data-sensei-block-id="efad44b7-2ecc-4942-8316-b68f62cbe2e2" data-sensei-wp-block="{&quot;blockId&quot;:&quot;efad44b7-2ecc-4942-8316-b68f62cbe2e2&quot;,&quot;draft&quot;:false,&quot;x&quot;:55.53571428571429,&quot;y&quot;:24.136904761904763}"><button class="sensei-lms-image-hotspots__hotspot-marker" style="left:55.53571428571429%;top:24.136904761904763%"><a></a></button><div class="sensei-lms-image-hotspots__hotspot-tooltip wp-block-sensei-pro-image-hotspots-hotspot" style="--y:24.14%;--x:55.54%"><span class="sensei-lms-image-hotspots__hotspot-tooltip-arrow"></span><!--sensei:inner-blocks-->

<!--/sensei:inner-blocks--></div></div>

What's interesting is that when I test this on my local development environment, I cannot replicate this error, which makes me think it's either to something elsewhere in the .org codebase and not something in the wporg-learn theme or plugin.

@jonathanbossenger jonathanbossenger changed the title Sensei: Content block error Issue with Sensei Image Hotspot blocks Nov 14, 2023
@jonathanbossenger jonathanbossenger removed the Awaiting Triage Issues awaiting triage. See Training Team handbook for how to triage issues. label Nov 14, 2023
@kaitohm kaitohm moved this to Triaged to-dos in LearnWP Website Development Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug Something isn't working on the Learn website.
Projects
Status: To do
Development

No branches or pull requests

2 participants