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: support character deletion while holding down the Shift key. #659

Merged

Conversation

Jayaprakash-dev
Copy link
Contributor

This fix is related to the bug in AppFlowy-IO/AppFlowy:

[Bug] Shift blocks backspace deletion # 4279
[link]: AppFlowy-IO/AppFlowy#4279

I've addressed the reported issue with the following changes:

Issue:
When the shift key is held down, deleting a character or selection by pressing backspace is not functioning as expected.

Solution:
I've implemented a fix by assigning the same Backspace handler in backspace_command.dart to another command shortcut event handler named deleteLeftCharacterCommand which is responsible for handling shift+backspace shortcut event. This adjustment ensures that the deletion functionality works seamlessly, resolving the reported bug.

Repository Context:
Although the issue is posted in another related repository AppFlowy-IO/AppFlowy, the code files relevant to this bug are present in this repository. Therefore, I've created this PR here.

Additional Changes:
I've also included the required test files to ensure the reliability of this fix.

@CLAassistant
Copy link

CLAassistant commented Jan 9, 2024

CLA assistant check
All committers have signed the CLA.

@LucasXu0
Copy link
Collaborator

LucasXu0 commented Jan 9, 2024

It's not necessary to define a new shortcut command for Shift+Backspace. Simply adding this shortcut (Shift+Backspace) to the existing Backspace command is enough.

@Jayaprakash-dev Jayaprakash-dev force-pushed the fix_shift_blocks_backspace_deletion branch from 5470c6a to 2856714 Compare January 9, 2024 14:52
@Jayaprakash-dev
Copy link
Contributor Author

Jayaprakash-dev commented Jan 9, 2024

@LucasXu0, Just got to know, that new shortcuts can be added to existing command handlers through a comma-separated string. As a result, I removed the unnecessary deleteLeftCharacterCommand handler along with its unit tests. However, I retained the widget tests for the shift+backspace command event.

Thanks for the clarification!

@Jayaprakash-dev Jayaprakash-dev changed the title fix: support deletion of character using [shift+backspace] command shortcut fix: support character deletion while holding down the Shift key. Jan 9, 2024
Copy link

codecov bot commented Jan 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (87eabfb) 76.50% compared to head (2856714) 76.50%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #659   +/-   ##
=======================================
  Coverage   76.50%   76.50%           
=======================================
  Files         295      295           
  Lines       13039    13039           
=======================================
  Hits         9975     9975           
  Misses       3064     3064           

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

@LucasXu0 LucasXu0 merged commit a8a88c4 into AppFlowy-IO:main Jan 10, 2024
11 checks passed
q200892907 added a commit to q200892907/appflowy-editor that referenced this pull request Jan 11, 2024
* main:
  chore: bump version 2.3.0 (AppFlowy-IO#668)
  fix: support character deletion while holding down the Shift key. (AppFlowy-IO#659)
  fix: solve the focus problem caused by monitoring onFocusChange and change to monitoring click events (AppFlowy-IO#660)
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.

3 participants