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

Ajax loaded editor is not refreshing API managed content #1491

Open
dermicha56 opened this issue Oct 16, 2024 · 2 comments
Open

Ajax loaded editor is not refreshing API managed content #1491

dermicha56 opened this issue Oct 16, 2024 · 2 comments
Labels
bug:core Bug in core (trumbowyg.js)

Comments

@dermicha56
Copy link

dermicha56 commented Oct 16, 2024

Description

OS: Windows, MacOS
Browser: Chrome

Initially, when typing any content and checking the value with .trumbowyg('html'), it will return the empty string ''

The loaded Trumbowyg editor is not visibly populated by using .trumbowyg('html', '<p>Content</p>')
After setting the value with the above command, .trumbowyg('html') returns '<p>Content</p>'

How to reproduce?

Load Trumbowyg form via Ajax -> Manage Content with custom JS function

image

@Alex-D
Copy link
Owner

Alex-D commented Oct 18, 2024

Hey
I've tried on my side:

$('textarea').trumbowyg();
setTimeout(() => {
	$('textarea').trumbowyg('html', '<h1>Hey</h1>');
}, 1000);

And it works fine :)

@Alex-D
Copy link
Owner

Alex-D commented Oct 18, 2024

OK, so it is broken. You're building the editor on something that differs from a textarea element... If you switch from your div to a textarea, it should work

@Alex-D Alex-D added the bug:core Bug in core (trumbowyg.js) label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:core Bug in core (trumbowyg.js)
Projects
None yet
Development

No branches or pull requests

2 participants