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

Inserted HTML <button> gets immediately removed #415

Open
Patapom opened this issue Aug 13, 2021 · 4 comments
Open

Inserted HTML <button> gets immediately removed #415

Patapom opened this issue Aug 13, 2021 · 4 comments

Comments

@Patapom
Copy link

Patapom commented Aug 13, 2021

Hello, I tried to add some HTML within the editor div that contains a clickable <button onclick="doStuff()">Test</button>, I can see the button for a short time then it gets removed and replaced by a div instead.
Is there a way to configure/prevent this behavior?

@natamartins
Copy link

Hello @Patapom how are you? so the way you wrote it is wrong, I think that must be the cause of the problem! Once you write the button function

<button onClick={ doStuff() }>Teste

for the function you called to work, it needs to be inside the {} and not "", understand?
you can try this!

@Patapom
Copy link
Author

Patapom commented Sep 7, 2023 via email

@the-djmaze
Copy link

https://github.com/fastmail/Squire#readme

Squire is an HTML5 rich text editor, which provides powerful cross-browser normalisation in a flexible lightweight package (only 16KB of JS after minification and gzip, with no dependencies!).

It was designed to handle email composition for the Fastmail web app.

Does email handle forms (input, select, textarea, button)?

@bytesnz
Copy link

bytesnz commented Sep 11, 2024

I have created a commit that allows the allowed block elements (and blacklisted elements) to specified in the config, replacing the regular expressions with a Set instead. Not sure if this is something you would be interested in doing for Squire.

I'm doing a bit more hacking so I can use it in one of the projects I'm working on so it can be used for editing less common and custom HTML blocks.

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

4 participants