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: toolbar menu not showing beacase keyboard height is not updated in time #7060

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

asjqkkkk
Copy link
Collaborator

@asjqkkkk asjqkkkk commented Dec 26, 2024

Related to #7049

last one is embedded link on a text, every after using the feature once, i can't open the menu again, i need to close the keyboard first to use it again

Feature Preview

PR Checklist

  • My code adheres to AppFlowy's Conventions
  • I've listed at least one issue that this PR fixes in the description above.
  • I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes.
  • All existing tests are passing.

/// there will be an issue with the height being 0
/// this is used to globally record the height.
static double _maxKeyboardHeight = 0.0;
ValueNotifier<double> cachedKeyboardHeight =
Copy link
Collaborator

Choose a reason for hiding this comment

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

If _maxKeyboardHeight is used as the initial value every time, cachedKeyboardHeight will never be 0 after the first initialization. I assume this might have side effects on other logic, such as closing the keyboard.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

cachedKeyboardHeight is used to keep the same height when the menu is shown, and it was controlled by canUpdateCachedKeyboardHeight, after _MobileToolbar disposed and recreated a new one, cachedKeyboardHeight will be set to 0, that will cause the issue —— #7049, and using _globalCachedKeyboardHeight can prevent the issue caused by its rapid re-initialization before the height can be obtained

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