Open Tca1107 opened 7 years ago
quill.format('header', '1') doesn't change the default, it just set the current used format.
Please provide the exact steps to reproduce the "Heading 1" changes back to "Normal" issue including browser, OS and Quill version.
Hello benbro and thank you for your answer.
Browser: Chrome Version 55.0.2883.87 OS: Windows 10 Quill: 1.1.5
Steps to reproduce the problem:
Steps to reproduce a similar problem:
Is there maybe a way to change the default value ("Normal") to the last selection that was last active?
Thanks for your help.
Again, in your example you didn't set the default format you only changed the active format so I don't think there is an issue here.
Not sure it makes much sense to make H1 or Bold the default. Maybe you can change the default look with CSS instead? @jhchen is there a way to set a default format?
Thanks for your answer. I see that I did not change the default format.
Maybe try it this way:
or:
I guess what I am looking for is a way to make the dropdown menu show its last active value, if I click out of the text area or in the dropdown menu itself..
Thanks for your help.
Edit: If you add another dropdown for selecting font families a similiar behavior can be observed. If you mark some text in the editor, and set the font size as well as the font itself to another than the default values and then click again on one of the two dropdowns, both of the current selections change to the default values. I know what I am trying to describe is a bit confusing, sorry about that.
So you want an the editor to always be heading: 1 unless the user specifies otherwise? I'm not sure I understand what you are trying to do.
Hello jhchen and thank for your answer.
Hm, no, that is not what I mean. Maybe "default" is not the right word to describe what I am trying to explain. I think I confused the header option with the size option before. Sorry for the confusion. I created another example, maybe that will make it clearer. The main problem concerns the current selection which the different dropdowns (for font size and font family) display when the user formats text they wrote. You can find the new example here: http://codepen.io/anon/pen/XpWmLM
Steps:
Behavior: When you click on the font family dropdown menu to open the different options available, the current selection of the font size dropdown does no longer show the selection you made in step 2 ("huge"); instead, it displays "normal". However, as soon as you click on a font family option and thus select a new font for your text, the current font size selection shows the previously selected value again.
I am having trouble with the toolbar options. Please have a look at this example, which somebody posted on another issue earlier: http://codepen.io/anon/pen/BQXEJL
In it, some configurations have been made in the JS code concerning tohe toolbar (example: quill.format('header', '1');). However, whenever I click somewhere in the toolbar, these configurations are gone. Instead the default values are reinstalled. For instance, "Heading 1" changes back to "Normal". The same keeps happening when I actually want to change the font size myself. If I click on the dropdown menu, the selection suddenly shows "Normal" instead of the correct selection, which would be "Heading 1".
Is there any way to prevent quill from showing this behavior? I mean, a way to make it keep the right selection (in my case: "Heading 1")?
Thank you for you help!