-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Input returns empty string if defaultValue not changed #764
Comments
Sounds like a bug, and your analysis seems right. Feel free to send a pull request fixing this if you have time! |
The issue is still existed in the latest stable version 2.1.2. |
The issue still exists on version 2.1.2. |
This fix was backed out via #774 for some reason. |
The same error |
Same error as well |
Anyone have a solution to this? I still get the same issue. |
The same error is still exists |
This bug still exists! |
This issue still exists. |
This bug still exists!
|
A swal with an input element will return an empty string if the original value is unchanged. For example:
The value of
retVal
isnull
if you hit cancel""
if you hit okay"somestring"
if you actually change the input""
if you remove all the text and submit an empty stringIt should be "hello" if you hit okay, not an empty string. There is no way to determine if someone removed all the text and wants to submit an empty string, or if they submitted the defaultValue/value.
I have tried changing
value
todefaultValue
and that has no effect.I believe this is because the input element is only calling
setActionValue
on change, and it on init it should be checking if it has a defaultValue, and then callingsetActionValue(this.defaultValue)
The text was updated successfully, but these errors were encountered: