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

Placeholder String doesn't take control characters in string. #1839

Open
1 task done
SMH-Lily opened this issue Apr 28, 2024 · 1 comment
Open
1 task done

Placeholder String doesn't take control characters in string. #1839

SMH-Lily opened this issue Apr 28, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@SMH-Lily
Copy link

Is there an existing issue for this?

Flutter Quill version

9.3.4

Steps to reproduce

placeholder: '''Here are a few ideas:

• Daily Goals
• Client Insights...

Make the most of it!''',

or:
placeholder: 'Here are a few ideas:\n\n• Daily Goals\n• Client Insights...\n\nMake the most of it!',

Expected results

image

Actual results

image

Code sample

Code sample
Column(
                          children: [
                            Expanded(
                              child: QuillEditor.basic(
                                configurations: QuillEditorConfigurations(
                                  controller: _controller,
                                  readOnly: false,
                                  placeholder: '''Here are a few ideas: 
                                      • Daily Goals
                                      • Client Insights...
                                      Make the most of it!''',
                                  customStyles: DefaultStyles(
                                      placeHolder: DefaultListBlockStyle(
                                          TextStyle(
                                              fontSize: 16,
                                              color:
                                                  Colors.grey.withOpacity(.7)),
                                          const VerticalSpacing(1, 1),
                                          const VerticalSpacing(1, 1),
                                          null,
                                          null)),
                                  sharedConfigurations:
                                      const QuillSharedConfigurations(
                                          locale: Locale('en')),
                                ),
                              ),
                            ),
                            QuillToolbar.simple(
                              configurations: QuillSimpleToolbarConfigurations(
                                controller: _controller,
                                sharedConfigurations:
                                    const QuillSharedConfigurations(
                                  locale: Locale('en'),
                                ),
                              ),
                            ),
                          ],
                        )

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]
@SMH-Lily SMH-Lily added the bug Something isn't working label Apr 28, 2024
@CatHood0
Copy link

CatHood0 commented May 5, 2024

Your problem is due to \n. When placed intrinsically in the string, the string will add or print new lines (whatever we want, but causing problems) as it should. But you need to pass a string like:

r"Here are some ideas:\n\n• Daily goals\n• Client insights...\n\nMake the most of it!'"
Either

"Here are some ideas:\\n\\n• Daily goals\\n• Client insights...\\n\\nMake the most of it!'"

With these ropes you can solve this problem. This happens because the delta needs to have only \n as characters, in the string instead of intrinsic newlines.

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