Skip to content

fix(forms): prevent implicit form submission from grid - #17741

Open
igdmdimitrov wants to merge 9 commits into
masterfrom
dmdimitrov/fix-17638
Open

igdmdimitrov wants to merge 9 commits into
masterfrom
dmdimitrov/fix-17638

Conversation

@igdmdimitrov

@igdmdimitrov igdmdimitrov commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Closes #17638

Type of Change (check all that apply):

  • Bug fix
  • New functionality
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring (no functional changes)
  • Documentation
  • Demos
  • CI/CD
  • Tests
  • Changelog
  • Skills/Agents

Component(s) / Area(s) Affected:

Snackbar, Query Builder, Grid

How Has This Been Tested?

  • Unit tests
  • Manual testing
  • Automated e2e tests

Checklist:

  • All relevant tags have been applied to this PR
  • This PR includes unit tests covering all the new code (test guidelines)
  • This PR includes API docs for newly added methods/properties (api docs guidelines)
  • This PR includes feature/README.MD updates for the feature docs
  • This PR includes general feature table updates in the root README.MD
  • This PR includes CHANGELOG.MD updates for newly added functionality
  • This PR contains breaking changes
  • This PR includes ng update migrations for the breaking changes (migrations guidelines)
  • This PR includes behavioral changes and the feature specification has been updated with them
  • Accessibility (ARIA, keyboard navigation, focus management) has been verified

Copilot AI balanced review requested due to automatic review settings October 7, 2026 10:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The focused implementation correctly resolves the reported behavior and includes appropriate regression coverage.

Review effort: Balanced
Findings: None

What changed in this PR

Prevents the snackbar action button from implicitly submitting a containing form.

Changes:

  • Sets the default action button’s type to button.
  • Adds unit coverage for the button type.
  • Documents the fix in the changelog.
File Description
snackbar.component.html Adds the explicit button type.
snackbar.component.spec.ts Verifies the rendered type attribute.
CHANGELOG.md Records the form-submission fix.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread CHANGELOG.md Outdated
@mddragnev

Copy link
Copy Markdown
Member

@igdmdimitrov
The issue still reproduces. Add a toolbar with the pinning or hiding action, open it, type something in the search input and press Enter. The page refreshes.

With type="button" on the snackbar, the form no longer has a submit button. But the HTML spec still allows implicit submission when a form with no submit button has only one text-like input: pressing Enter in that input submits the form. The column actions search input is that one input, so Enter submits the form.

Adding type="button" to individual buttons won't cover this. We need a more general fix that cancels the default action of Enter for inputs inside the grid.

@mddragnev mddragnev added awaiting author When the reviewer/verifier has some confusions about the scenario/behavior and wait author's action and removed ❌ status: awaiting-test PRs awaiting manual verification labels Oct 7, 2026
@igdmdimitrov igdmdimitrov changed the title fix(snackbar): add type="button" fix(forms): prevent implicit form submission from grid Oct 14, 2026
@igdmdimitrov igdmdimitrov added ❌ status: awaiting-test PRs awaiting manual verification and removed awaiting author When the reviewer/verifier has some confusions about the scenario/behavior and wait author's action labels Oct 20, 2026

@viktorkombov viktorkombov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verified locally on 8153548: the new spec plus the snackbar, query builder and pivot selector specs pass (194/194), the grid filtering/editing/toolbar/keyboard-nav suites pass (697/697), and with the production changes reverted 8 of the 11 new tests fail, so the spec guards the fix. Also checked a standalone igx-grid-excel-style-filtering inside a form: its custom dialog is attached through the grid body view container, so the grid listener covers it too. Two non-blocking nits inline.

Comment thread projects/igniteui-angular/grids/grid/src/grid-base.directive.ts Outdated
Comment thread CHANGELOG.md Outdated

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing type="button" on snackbar action button

5 participants