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

refactor: Move preventDefault in move up and move down events [FC-0076] #189

Merged
merged 2 commits into from
Feb 13, 2025

Conversation

ChrisChV
Copy link
Member

@ChrisChV ChrisChV commented Feb 6, 2025

Description

  • Move the preventDefault function before the conditional in poll-move-up and poll-move-down click events.
  • This change is to avoid opening a new tab page when clicking the Move up/Move down buttons when the Poll block is in an Iframe

Suporting information

Testing instructions

  • Checkout this branch locally
  • Add it to the tutor mount list using tutor mounts add ./xblock-poll
  • Rebuild images using tutor images build openedx-dev
  • Go to a Course
  • Go to Settings > Advanced Settings on the header menu
  • Make sure you have poll and survey on the "Advanced Module List"
  • Ensure you have poll and survey on the LIBRARY_SUPPORTED_BLOCKS on the .env.development file of the frontend-app-authoring.
  • Run tutor config save
  • Edit a Unit for a Course
  • Add a poll and survey blocks to a Unit.
  • Copy both blocks and paste them into a library.
  • Edit the poll block, check that the "Move up" and "Move down" buttons work well, and don't open a new page.
  • Edit the survey block, check that the "Move up" and "Move down" buttons work well, and don't open a new page.

- Move the `preventDefault` function before the conditional in `poll-move-up` and `poll-move-down` click events.
- This change is to avoid open a new tab page when clicking the Move up/Move down buttons when the Poll block is in an Iframe
@ChrisChV ChrisChV changed the title refactor: Move preventDefault in move up and move down events refactor: Move preventDefault in move up and move down events [FC-0076] Feb 6, 2025
Copy link
Member

@pomegranited pomegranited left a comment

Choose a reason for hiding this comment

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

👍 Works perfectly :)

  • I tested this by editing both poll and survey blocks in a library, a course (new UI), and in the legacy studio unit UI.
  • I read through the code
  • I checked for accessibility issues by using my keyboard to navigate
  • Includes documentation N/A
  • User-facing strings are extracted for translation N/A

@pomegranited
Copy link
Member

@ChrisChV Oh I forgot -- you should bump the version in poll/__init__.py so we can tag a new release after merging this.

@ChrisChV ChrisChV merged commit 3f1fdef into master Feb 13, 2025
5 checks passed
@ChrisChV ChrisChV deleted the chris/FAL-4041-fix-prevent-default branch February 13, 2025 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants