Skip to content

Define an optional value and use it for setting dialog returnValue #11280

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

lukewarlow
Copy link
Member

@lukewarlow lukewarlow commented May 1, 2025

Define a new 'optional value' for buttons and submit inputs, this is used instead of 'value' when setting a dialog's returnValue.

Fixes #11092

(See WHATWG Working Mode: Changes for more details.)


/form-control-infrastructure.html ( diff )
/form-elements.html ( diff )
/input.html ( diff )
/interactive-elements.html ( diff )

Define a new 'optional value' for buttons and submit inputs,
this is used instead of 'value' when setting a dialog's returnValue.
@lukewarlow
Copy link
Member Author

@annevk hopefully this is roughly what you had in mind?

Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

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

I had forgotten about this, but this looks like an improvement over the status quo.

Add submit button check.

ought to be used*
@lukewarlow lukewarlow force-pushed the form-submit-returnvalue-fix branch from a54c9f8 to cadc51c Compare May 7, 2025 22:37
Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

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

Modulo Infra-alignment this looks good. Thanks for tackling it!

Comment on lines +51413 to +51415
<p>The element's <span data-x="concept-fe-optional-value">optional value</span> is the value of
the element's <code data-x="attr-button-value">value</code> attribute, if there is one, or null
otherwise.</p>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<p>The element's <span data-x="concept-fe-optional-value">optional value</span> is the value of
the element's <code data-x="attr-button-value">value</code> attribute, if there is one, or null
otherwise.</p>
<p>The element's <span data-x="concept-fe-optional-value">optional value</span> is the value of
the element's <code data-x="attr-button-value">value</code> attribute, if there is one; otherwise
null.</p>

Comment on lines +53872 to 53875
data-x="attr-button-value">value</code> attribute, if there is one, or the empty string otherwise.
The element's <span data-x="concept-fe-optional-value">optional value</span> is the value of the
element's <code data-x="attr-button-value">value</code> attribute, if there is one, or null
otherwise.</p>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
data-x="attr-button-value">value</code> attribute, if there is one, or the empty string otherwise.
The element's <span data-x="concept-fe-optional-value">optional value</span> is the value of the
element's <code data-x="attr-button-value">value</code> attribute, if there is one, or null
otherwise.</p>
data-x="attr-button-value">value</code> attribute, if there is one; otherwise the empty string.
The element's <span data-x="concept-fe-optional-value">optional value</span> is the value of the
element's <code data-x="attr-button-value">value</code> attribute, if there is one; otherwise
null.</p>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Ambiguous wording in form submission leads to interop issue
2 participants