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

ShortcutEvents are not working on mobile platform. #2370

Open
1 task done
hjkim-mango opened this issue Nov 11, 2024 · 3 comments
Open
1 task done

ShortcutEvents are not working on mobile platform. #2370

hjkim-mango opened this issue Nov 11, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@hjkim-mango
Copy link

Is there an existing issue for this?

Flutter Quill version

10.8.5

Steps to reproduce

  1. Write '' at first and then jot something down and write '' at last.
  2. Write '-' at first and then press the Spacebar.
  3. Write '#' at first and then press the Spacebar.

Expected results

On Step 1, characters should be changed to Italic style.
On Step 2, the block style of this line should be changed to the bulleted list.
On Step 3, the block style of this line should be changed to the numbered list.

Actual results

Nothing are changed.

Additional Context

Screenshots / Video demonstration
shortcutEventIssueOniOS.mov
shortcutEventIssueOnAndroid.mov
Source Codes
import 'package:flutter/material.dart';
import 'package:flutter_quill/flutter_quill.dart' as quill;

class FlutterQuillWidget extends StatefulWidget {
  const FlutterQuillWidget({super.key});

  @override
  State<FlutterQuillWidget> createState() => _FlutterQuillWidgetState();
}

class _FlutterQuillWidgetState extends State<FlutterQuillWidget> {
  late quill.QuillController _controller;
  final _editorFocusNode = FocusNode();
  final _editorScrollController = ScrollController();
  bool canScroll = false;

  @override
  void initState() {
    super.initState();
    _controller = quill.QuillController(
        document: quill.Document(),
        selection: const TextSelection.collapsed(offset: 0));
  }

  @override
  void dispose() {
    _controller.dispose();
    _editorFocusNode.dispose();
    _editorScrollController.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        resizeToAvoidBottomInset: false,
        appBar: AppBar(
          title: const Text('Flutter Quill'),
        ),
        body: Column(
          children: [
            Expanded(
                child: SingleChildScrollView(
                    controller: _editorScrollController,
                    child: Column(children: [
                      quill.QuillToolbar.simple(controller: _controller),
                      quill.QuillEditor(
                        controller: _controller,
                        scrollController: _editorScrollController,
                        focusNode: FocusNode(),
                        configurations: quill.QuillEditorConfigurations(
                            scrollable: false,
                            characterShortcutEvents:
                                quill.standardCharactersShortcutEvents,
                            spaceShortcutEvents:
                                quill.standardSpaceShorcutEvents,
                            expands: false,
                            placeholder: "Add your data here..."),
                      ),
                    ])))
          ],
        ));
  }
}

@hjkim-mango hjkim-mango added the bug Something isn't working label Nov 11, 2024
@EchoEllet
Copy link
Collaborator

This is the expected behavior, it's unsupported on mobile devices, and it needs more docs.

@hjkim-mango
Copy link
Author

Any plan to support shortcut events for mobile devices?

@EchoEllet
Copy link
Collaborator

EchoEllet commented Nov 12, 2024

Currently, it's unsupported by default using the built-in Flutter platform channels (flutter/services), if we had plans, we would need platform code for Android and iOS, which will be in the plugin quill_native_bridge.

This plugin is not in a state where we can add more features, need to fix the TODOs and the current issues first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants