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: lexemes cannot be disabled as button is rendered outside of form #776

Merged
merged 1 commit into from
Feb 12, 2024

Conversation

m90
Copy link
Contributor

@m90 m90 commented Feb 8, 2024

Copy link

github-actions bot commented Feb 8, 2024

Deployment previews on netlify for branch refs/pull/776/merge will be at the following locations (when build is done):


<v-card-actions>
<v-spacer></v-spacer>
<v-tooltip top>
<template v-slot:activator="{ on, attrs }">
<v-btn color="primary" v-bind="attrs" v-on="on" text type="submit">
<v-btn v-bind="attrs" v-on="on" color="primary" type="submit" form="formLexeme">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First problem here would be that albeit the button is within the parent form in the template, Vue will hoist it outside of the form when rendering the modal, meaning submitting it would go nowhere as there's no associated form.

There are two solutions to the problem:

  • give the form an id and reference it here (like I did)
  • on clicking this button, programatiicaly submit the form

I think both is ok.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks nice

valid: false,
dialog: false,
userConfirmationString: 'wbstack-important-change',
rules: {
match: (value) =>
value === this.userConfirmationString || 'Please enter the confirmation'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Second problem was that this here would be the Vue component, not the data object, thus returning undefined instead of the value of userConfirmationString

Also the comparison is borked and would return either true|'Please enter the confirmation' instead of true|false

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm very unclear how this ever really worked

Copy link
Contributor

@tarrow tarrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm; also checked it worked as expected in the prod version of netlify

@m90 m90 merged commit 0cc1e5a into main Feb 12, 2024
8 checks passed
@m90 m90 deleted the fr/fix-disable-lexeme branch February 12, 2024 08:53
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