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

Fix dependsOn Feature #232

Closed

Conversation

LorenzoAlu
Copy link
Contributor

@LorenzoAlu LorenzoAlu commented Aug 11, 2023

Hi :D

I found the bug in the code by comparing it with the native Laravel Nova code.
I improved the return on visibility and it seems to work correctly now ;)
Below is the native Nova code in dependFormField.js:

...

computed: {
    ...
    /**
     * Determine if the field is in visible mode
     */
    currentlyIsVisible() {
      return this.currentField.visible
    },
    ...
}
methods: {
    /**
     * Provide a function to fills FormData when field is visible.
     */
    fillIfVisible(formData, attribute, value) {
      if (this.currentlyIsVisible) {
        formData.append(attribute, value)
      }
    },
...

ps: Congratulations again on your great work ;)

@Tarpsvo
Copy link
Collaborator

Tarpsvo commented Aug 25, 2023

Heya! Thanks for the PR. :) The fix is now live in version 4.4.2.

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.

2 participants