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
Add custom HTML alert support #129
Conversation
Wouldn't it be better if there's another option, |
I agree with @samacs that html is not a type of dialog, it is a different feature completely. I could want to make an error dialog with html within. Unfortunately I don't think that the project owner wants to allow HTML in the alerts at all. |
Looking at the code, seems very easy to support this feature, but the modal's markup is out of the scope of the parameters so we cannot decide how to define the markup if it will allow HTML. I just glanced the code so I cannot tell if this is completely true. I'll make a pr in my free time and push the branch. |
Well, if that's the case, @pomartel lets fork it and add the feature -.- |
Maybe there is something I don't understand but why would we want to escape the HTML at all? Why not give total freedom to the developer to put what he wants in the alert? In my opinion, this should not even be an option so I just removed |
(y) |
Yeah, you guys are right. It should be another option ( |
@huytd that should probably apply to the title as well. |
I added a commit to use |
In that particular PR you shouldn't change/fix the icon thingy as it is totally separate subject and should be in a separete PR |
With HTML support you're bound to put lots of other things in the alert. Which creates issues if the alert becomes bigger than the window height. Add scrolling with the HTML support or a separate issue? |
@vmitchell85 I think the main use case for html in the alert is to add links in the text or basic styling tags. I don't see what's the added value of stripping html tags. Why not let the developer choose what he wants to put in his alerts? |
@pomartel - I wasn't advocating not using HTML, I am 100% for HTML... my concern is that if you put enough items into the alert and the window is small you currently can't scroll (as I've downloaded this code change and tested) |
Hey, |
Same error as @Ashwinning : did you managed to fix it ? |
Hi, |
@huytd I added this feature and some other additional options in sweetalert2. |
This is now possible through the |
Add new alert type: HTML
EDIT: now using
allowHtml
option instead oftype
This will allow creating HTML alert box, can be use to create custome dialog types, for example: Prompt, Date picker,...
Usage: