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

Plugin fontsize doesn't change the value of textarea #1108

Closed
WebCimes opened this issue Apr 28, 2020 · 3 comments
Closed

Plugin fontsize doesn't change the value of textarea #1108

WebCimes opened this issue Apr 28, 2020 · 3 comments
Labels
bug:plugin Bug in a plugin

Comments

@WebCimes
Copy link

WebCimes commented Apr 28, 2020

Hi,
I have the latest version of trumbowyg (2.21.0) and I have a bug when I try to change the fontsize of the text, the plugin change the size but if I try to get the value of the textarea I get the text without the new font-size style. But if I do another change after (like new character in the text or bold for exemple, the text get the right style).

For exemple :

If I have a text :
Lorem ipsum dolor sit amet

And I change "ipsum" with the "18px" fontsize in the dropdown list.

$("textarea").trumbowyg( { btns: [['strong'], ['fontsize']], plugins: { fontsize: { sizeList: [ '14px', '18px', '22px' ], allowCustomSize: true } } }).on('tbwblur', function() { console.log($("textarea").val()); });

When I change the fontsize (by 18px), the console return <p>Lorem ipsum dolor sit amet</p>

But if I add a new word after like "Lorem ipsum dolor sit amet test" the console return <p>Lorem <span style="font-size: 18px;">ipsum </span>dolor sit amet</p>

You can try without the event "tbwblur" too, after change de fontsize just enter "console.log($("textarea").val());" in the console you will see that nothing have change.

The bug only append with the "dropdown list / sizeList", but with the "custom" button (allowCustomSize) all is working well.

Thanks for your beautiful plugin, and I hope you will find a solution for this problem.

@Alex-D
Copy link
Owner

Alex-D commented Apr 28, 2020

There is a fix on the develop branch that I need to tag :)
I will do that soon!

EDIT:
Hum, nope, the bug that you mention is another one in fact... you expect that the textarea is up to date, but is not... again a syncCode seems missing ^^'

I will check that ASAP.

@WebCimes
Copy link
Author

Ok thanks for your answer :)

@Alex-D Alex-D added the bug:plugin Bug in a plugin label Apr 30, 2020
@Alex-D Alex-D closed this as completed Nov 26, 2020
@Alex-D
Copy link
Owner

Alex-D commented Nov 26, 2020

Fixed in 2.22, same as #1117

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:plugin Bug in a plugin
Projects
None yet
Development

No branches or pull requests

2 participants