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: exception on prev node text direction null #404

Merged
merged 4 commits into from
Aug 29, 2023

Conversation

zoli
Copy link
Contributor

@zoli zoli commented Aug 22, 2023

The code was throwing exception on changing the current node text
direction to auto when the previous node had a text direction attribute
with null value.
Also changed to only use direct previous node text direction and
direct parent for inheriting text direction when the current node
text direction is auto and undeterminable (e.g. empty text).

This should get merged after #402.

Introduced default text direction property on editor style. which
accepts rtl|ltr|auto for controlling default fallback direction.
Before this we had something controlled by Directionality but it
had two problems:
1. It didn't accept auto text direction. We had to introduce our
own Directionality component.
2. Directionality also affects layout direction, for example
setting Directionality to RTL will cause the handlers and other
things move to right side of the screen. While this is good but
there are cases which we don't want to change whole layout direction
but only the text default direction to for example auto.
The code was throwing excenption on changing current node text
direction to auto when the previous node had text direction attribute
with null value.
Also changed to only use direct previous node text direction and
direct parent for inheriting text direction when the current node
text direction is auto and undeterminable (e.g. empty text).
@zoli zoli changed the title feat: default text direction property fix: exception on prev node text direction null Aug 22, 2023
@LucasXu0
Copy link
Collaborator

@zoli I have merged #402 already. Please resolve the conflicts.

@zoli
Copy link
Contributor Author

zoli commented Aug 28, 2023

@zoli I have merged #402 already. Please resolve the conflicts.

Done.

@codecov
Copy link

codecov bot commented Aug 28, 2023

Codecov Report

Merging #404 (e93e030) into main (9105812) will increase coverage by 0.01%.
The diff coverage is 90.00%.

@@            Coverage Diff             @@
##             main     #404      +/-   ##
==========================================
+ Coverage   80.58%   80.59%   +0.01%     
==========================================
  Files         255      255              
  Lines       10448    10455       +7     
==========================================
+ Hits         8419     8426       +7     
  Misses       2029     2029              
Files Changed Coverage Δ
lib/src/render/selection/selectable.dart 50.00% <0.00%> (ø)
...component/base_component/text_direction_mixin.dart 100.00% <100.00%> (ø)

@LucasXu0 LucasXu0 merged commit e2fc87f into AppFlowy-IO:main Aug 29, 2023
10 checks passed
@zoli zoli deleted the fix/previous-node-text-direction-null branch August 29, 2023 08:03
q200892907 added a commit to q200892907/appflowy-editor that referenced this pull request Sep 5, 2023
* main:
  feat: simplify auto scroll behavior in ScrollServiceWidget (AppFlowy-IO#437)
  chore: bump version 1.3.0 (AppFlowy-IO#435)
  fix: better column resize performance (AppFlowy-IO#434)
  fix: table padding and selection (AppFlowy-IO#432)
  fix: table block bugs (AppFlowy-IO#431)
  fix: refactor text alignment handling in block components
  Revert "fix: remove flutter overlay (AppFlowy-IO#358)" (AppFlowy-IO#427)
  feat: support alignment for block component (AppFlowy-IO#425)
  fix: remove flutter overlay (AppFlowy-IO#358)
  feat: toggle highlight using ctrl/cmd + shift + h (AppFlowy-IO#333)
  feat: table plugin (AppFlowy-IO#62)
  feat: editor state update node (AppFlowy-IO#405)
  fix: exception on prev node text direction null (AppFlowy-IO#404)
  fix: html encoder not adding multiple text decorations (AppFlowy-IO#424)
  feat: default text direction property (AppFlowy-IO#402)
  fix: fixed the cursor not moving to next line after inserting divider (AppFlowy-IO#371)
  chore: update theme colors for editor
  feat: refactor floating toolbar positioning logic
  fix: update resizable image width calculation with minimum width constraint
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