Problem/Motivation
FormBuilder::doBuildForm() contains specific support for an Internet Explorer quirk:
// If a form contains a single textfield, and the ENTER key is pressed
// within it, Internet Explorer submits the form with no POST data
// identifying any submit button. Other browsers submit POST data as
// though the user clicked the first button. Therefore, to be as
// consistent as we can be across browsers, if no 'triggering_element' has
// been identified yet, default it to the first button.
$buttons = $form_state->getButtons();
if (!$form_state->isProgrammed() && !$form_state->getTriggeringElement() && !empty($buttons)) {
$form_state->setTriggeringElement($buttons[0]);
}
It seems likely that this is obsolete now.
Steps to reproduce
Proposed resolution
GET forms (such as Views exposed filters) don't have to include a submit button input, so I think we should always default to the first button if we didn't find one - this makes sense to me and prevents breaking existing behaviour.
Therefore, the only thing to do here is update the comment so it's more accurate.
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Comments
Comment #2
aayushpathak commentedworking on it !
Comment #4
aayushpathak commentedComment #5
smustgrave commentedAppears to be breaking the tests so maybe it is used?
Comment #7
longwaveFull disclosure: trying something new here, using an AI agent to work on issues and tests in a private clone of core. There is always a human in the loop, I manually review and approve all output before pushing back here. Commits and pushes by @longwave-bot are from the agent.
The test changes here were written by DeepSeek v4 Flash.
Comment #8
longwaveAs the tests discovered this wasn't just for supporting an obsolete IE feature. GET forms (such as Views exposed filters) don't have to include a submit button input, so I think we should always default to the first button if we didn't find one - this makes sense to me and prevents breaking existing behaviour.
Therefore, the only thing to do here is update the comment so it's more accurate.
Comment #9
smustgrave commentedlooks like a good removal to me
Comment #12
godotislateCommitted and pushed cf54347 to main and 5e2df7d to 11.x. Thanks!
Comment #14
godotislate