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

feat(keyboard): support for customize onKey events, original PR #2345 #2368

Merged
merged 19 commits into from
Nov 11, 2024

Conversation

EchoEllet
Copy link
Collaborator

@EchoEllet EchoEllet commented Nov 10, 2024

Description

Note

See the original PR #2345, this branch is the same but pushed to this repo instead of the fork. Changes made by @CatHood0

Related Issues

Type of Change

  • Feature: New functionality without breaking existing features.
  • 🛠️ Bug fix: Resolves an issue without altering current behavior.
  • 🧹 Refactor: Code reorganization, no behavior change.
  • Breaking: Alters existing functionality and requires updates.
  • 🧪 Tests: New or modified tests
  • 📝 Documentation: Updates or additions to documentation.
  • 🗑️ Chore: Routine tasks, or maintenance.
  • Build configuration change: Build/configuration changes.

@@ -123,6 +126,38 @@ class QuillRawEditorConfig {
///```
final List<SpaceShortcutEvent> spaceShortcutEvents;

/// A handler for keys that are pressed when the editor is focused.
///
/// ### Supported by:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nit: How about Supported Platforms?

Or maybe remove this section entirely and mention that this feature is unsupported on mobile devices.
It would be slightly simpler and shorter.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This suggestion is probably better, and even more understandable. Perhaps adding that it is not supported on mobile devices would make more sense.

/// To prevent the user from removing any **Embed Object**, try:
///
///```dart
///onKeyPressed: (event, node) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nit: Space between the onKeyPressed and the docs comment.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: Space between the onKeyPressed and the docs comment.

It's purely a matter of visual taste. I prefer it this way. It's clear that in the end in Markdown this is irrelevant and will remove any spacing I put in.

Copy link
Collaborator Author

@EchoEllet EchoEllet Nov 11, 2024

Choose a reason for hiding this comment

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

It's though we have different tastes, and that makes the project docs style slightly inconsistent, I'm trying to use something that's commonly used in the project and known by most developers to make it easier to adapt.

This style is also quite common. It's used in Flutter (example code) and Dart (related Effective Dart section).

It's clear that in the end in Markdown this is irrelevant and will remove any spacing I put in.

It's irrelevant to the final result but not necessarily to the project code.

The if check code below has 3 spaces which might not make it formatted properly.

@EchoEllet EchoEllet marked this pull request as ready for review November 11, 2024 08:20
@EchoEllet EchoEllet merged commit 8107c19 into master Nov 11, 2024
3 checks passed
@EchoEllet EchoEllet deleted the CatHood0-prevent_default_event_behavior branch November 11, 2024 08:42
@EchoEllet
Copy link
Collaborator Author

LGTM.

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.

Flutter Quill Editor Custom Embed: Select Custom Dropdown on Backspace Key
2 participants