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

fix: image and paste insert #490

Merged
merged 3 commits into from
Jul 1, 2024

Conversation

KristinAoki
Copy link
Member

@KristinAoki KristinAoki commented Jun 28, 2024

Description

This PR fixes a bug introduced in #480 where content that is inserted like pasting and adding images always inserted it at the beginning of the block, not where the cursor was last placed. This bug appeared because the content was updated before the insert happened so the cursor was moved to the beginning of the block for the new content. This PR fixes the update function to only update the content when the content is actually changed, not on every editor click.

Supporting Information

JIRA Ticket: TNL-11663 🔒

Testing

  1. Open a tab for each page that uses the visual editors
    • text editor
    • problem editor
    • course updates
  2. Copy and paste text into various parts of the editor
    • in the middle of a sentence
    • end of block
    • highlight and replace
  3. Add an image
    • in the middle of a sentence
    • end of block
    • highlight and replace
  4. Confirm that each of these additions add content i the expected location

Copy link

codecov bot commented Jun 28, 2024

Codecov Report

Attention: Patch coverage is 92.30769% with 2 lines in your changes missing coverage. Please review.

Project coverage is 88.91%. Comparing base (2678234) to head (6b12726).

Files Patch % Lines
...rc/editors/sharedComponents/TinyMceWidget/hooks.js 92.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #490      +/-   ##
==========================================
+ Coverage   88.86%   88.91%   +0.05%     
==========================================
  Files         248      248              
  Lines        4535     4538       +3     
  Branches      934      937       +3     
==========================================
+ Hits         4030     4035       +5     
+ Misses        474      470       -4     
- Partials       31       33       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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