Skip to content

add defaultdata to submitDialogForm #57

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

Merged
merged 1 commit into from
Jul 18, 2019
Merged

add defaultdata to submitDialogForm #57

merged 1 commit into from
Jul 18, 2019

Conversation

fr-ser
Copy link
Contributor

@fr-ser fr-ser commented Jul 8, 2019

Adding the content of prompt even for regular form submit outside clicks
e.g. by clicking enter

The one-line change seems pretty obvious. I couldn't get the tests running on my machine otherwise I would have added a test.

Solves this bug: #52

Adding content of prompt even for regular form submit outside clicks
e.g. by clicking enter
@fr-ser
Copy link
Contributor Author

fr-ser commented Jul 8, 2019

I also did not build and commit (only built locally to check if it works).

I seriously have no idea about the test and deploy process here 😆

@Godofbrowser
Copy link
Owner

Thanks @fr-ser 🙌

@Godofbrowser Godofbrowser merged commit 32ea7b1 into Godofbrowser:master Jul 18, 2019
@Godofbrowser
Copy link
Owner

Also... Tests were broken for long, they should run now.

@jochemmeyers
Copy link

It looks like the fix never made it into the dist folder in version 1.4.1.

src/plugin/js/mixins/dialog-mixin.js contains the adjusted line in the submitDialogForm function:

submitDialogForm () {
    this.okBtnDisabled || this.proceed(this.getDefaultData())
},

but dist/vuejs-dialog-mixin.min.js contains this:

submitDialogForm:function(){this.okBtnDisabled||this.proceed()},

@nhsome
Copy link

nhsome commented May 21, 2020

Thanks for @jochemmeyers
@Godofbrowser, please update minified files and npm package.

#71

@decpk
Copy link

decpk commented Aug 29, 2020

This doesn't work even now in v1.4.1. How can we fix this issue? I mean if I don't enter any string in input and hit enter then it returns an empty string, that's fine but as soon as I enter some text and hit enter then it returns an object with data property as null.

@Godofbrowser
Copy link
Owner

Looking into this.

@Godofbrowser
Copy link
Owner

Updated

@decpk
Copy link

decpk commented Aug 29, 2020

constantly looking when it will get updated on npm bcz current project needs submitDialogForm.

@Godofbrowser
Copy link
Owner

@and-ocean2017 package has been updated on npm. Please let me know if new version resolves the issue so i can close #52

@decpk
Copy link

decpk commented Aug 30, 2020

yeah @Godofbrowser it resolves the null issue 👍, but I think it would be more convenient to show some kind of error if data property is an empty string (i.e if the user hit enter as soon as prompt shows without inserting data). There should be a kind of option maybe showEmptyError just to check if the user inserted data and hit enter then we are good to go else if data is an empty string then show error without closing the dialog box. So that user can inset data again.
we are manually checking here. There must be some OOB feature

try {
        const dialog = await this.$dialog.prompt({ title, promptHelp });
        if (dialog.data.length > 0) {
          // CONTAIN DATA
        } else {
         // DOESN'T CONTAIN DATA
      }

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

Successfully merging this pull request may close these issues.

5 participants