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

Toolbar ql-align render selected fail #228

Closed
bugkiwi opened this issue Jul 7, 2017 · 5 comments
Closed

Toolbar ql-align render selected fail #228

bugkiwi opened this issue Jul 7, 2017 · 5 comments

Comments

@bugkiwi
Copy link

bugkiwi commented Jul 7, 2017

[template]:

https://codepen.io/bugkiwi/pen/OgoRbw?editors=1010

image

FAQ

Toolbar ql-align not work well ?

Quill version

1.0.0

@alexkrolick
Copy link
Collaborator

alexkrolick commented Jul 7, 2017

https://quilljs.com/docs/formats/

You need to add align to the array passed as the formats prop to enable it

@alexkrolick
Copy link
Collaborator

alexkrolick commented Jul 7, 2017

Although... you are correct that even with the format enabled it does seem to be failing to show the default value. Duplicate of #175

@alexkrolick alexkrolick reopened this Jul 9, 2017
@alexkrolick
Copy link
Collaborator

alexkrolick commented Jul 9, 2017

Reopening as I've discovered that it's possible to fix this issue without fixing #175.

Submitted the fix upstream at slab/quill#1576.

Demo of broken behaviour: https://codepen.io/alexkrolick/pen/awRxWz?editors=0010
Demo of fixed Quill: https://codepen.io/alexkrolick/pen/qjMrEN

@alexkrolick
Copy link
Collaborator

slab/quill#1576 was merged

@bugkiwi
Copy link
Author

bugkiwi commented Jul 12, 2017

Sorry for late.

After your first resp, I have found there are maybe a bug on quill, and I read the Quilljs source. I found use

<select className="ql-align"></select>

without any options will be a good choice, Quilljs will give a default options. It works well. Maybe this will help some one.

And use defaultValue to replace selected is really a good decision;

Thanks for your help:)

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

No branches or pull requests

2 participants