the-airbender / quill_html_editor

HTML rich text editor for Android, iOS, and Web, using the QuillJS library. QuillJS is a free, open source WYSIWYG editor built for the modern web.
https://pub.dev/packages/quill_html_editor
MIT License
79 stars 77 forks source link

[BUG] How to change range selection text #161

Open antonydieu opened 6 months ago

antonydieu commented 6 months ago

Describe the bug editor can't move range selection text. Lib quill_html_editor: ^2.2.6

Smartphone (please complete the following information):

SingleChildScrollView(
              child: QuillHtmlEditor(
                text: "",
                hintText: 'Hint text goes here',
                controller: widget.controller,
                isEnabled: true,
                ensureVisible: true,
                minHeight: 200,
                autoFocus: true,
                textStyle: _editorTextStyle,
                hintTextStyle: _hintTextStyle,
                hintTextAlign: TextAlign.start,
                padding: const EdgeInsets.only(left: 10, top: 10),
                hintTextPadding: const EdgeInsets.only(left: 20),
                backgroundColor: _backgroundColor,
                inputAction: InputAction.newline,
                onEditingComplete: (s) => debugPrint('Editing completed $s'),
                loadingBuilder: (context) {
                  return const Center(
                      child: CircularProgressIndicator(
                        strokeWidth: 1,
                        color: Colors.red,
                      ));
                },
                onFocusChanged: (focus) {
                  debugPrint('has focus $focus');
                  setState(() {
                    _hasFocus = focus;
                  });
                },
                onTextChanged: (text) => debugPrint('widget text change $text'),
                onEditorCreated: () {
                  debugPrint('Editor has been loaded');
                  setHtmlText('');
                },
                onEditorResized: (height) =>
                    debugPrint('Editor resized $height'),
                onSelectionChanged: (sel) =>
                    debugPrint('index ${sel.index}, range ${sel.length}'),
              ),
            )

Flutter Doctor Please run flutter doctor in the terminal and add the log here. fvm flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.10.3, on macOS 14.2 23C64 darwin-arm64, locale en-VN) [!] Android toolchain - develop for Android devices (Android SDK version 33.0.2) ✗ cmdline-tools component is missing Run path/to/sdkmanager --install "cmdline-tools;latest" See https://developer.android.com/studio/command-line for more details. ✗ Android license status unknown. Run flutter doctor --android-licenses to accept the SDK licenses. See https://flutter.dev/docs/get-started/install/macos#android-setup for more details. [✓] Xcode - develop for iOS and macOS (Xcode 15.0.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2022.3) [✓] VS Code (version 1.85.1) [✓] Connected device (4 available) [✓] Network resources

! Doctor found issues in 1 category. Video demo

https://github.com/the-airbender/quill_html_editor/assets/5988428/c9e8565a-ae8c-4159-b59b-31f4bdd4fb8a

antonydieu commented 6 months ago

When focus to editor I need disable : physics: NeverScrollableScrollPhysics() when unfocus need set physics: AlwaysScrollableScrollPhysics(). But unfocus and focus work not exactly. I need check show or dismiss key board to set physics for SingleChildScrollView

the-airbender commented 6 months ago

Hello @antonydieu,

Could you please try it on a physical device and confirm if the issue exists?

Thanks :)

dongnqda commented 1 month ago

@the-airbender This issue persist on real device. Especially on iOS.

SlickSlime commented 3 weeks ago

@the-airbender I can also confirm this issue persists on physical iOS device.

quill_html_editor: ^2.2.8
Flutter 3.22.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 761747bfc5 (3 weeks ago) • 2024-06-05 22:15:13 +0200
Engine • revision edd8546116
Tools • Dart 3.4.3 • DevTools 2.34.3

This impacts the core functionality of the editor. Is there any hack/trick we can use in the meantime?