Skip to content

fix(forms): prevent implicit form submission from grid - 21.2.x - #17743

Open
igdmdimitrov wants to merge 3 commits into
21.2.xfrom
dmdimitrov/fix-17638-21.2.x
Open

igdmdimitrov wants to merge 3 commits into
21.2.xfrom
dmdimitrov/fix-17638-21.2.x

Conversation

@igdmdimitrov

@igdmdimitrov igdmdimitrov commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Closes #17638

Approach: a single internal helper, preventImplicitSubmission (igniteui-angular/core), cancels Enter only on inputs that belong to a form and would submit it (not button, submit, reset, image, file or color inputs). It reads the focused element through event.composedPath(), so elements inside shadow DOM are handled correctly. It runs on keydown and keypress, in the capture phase on the grid host. keypress is needed because a date picker that selects a day on Enter moves focus back to its input before the browser submits.

Used by: IgxGridBaseDirective (so it covers the tree, hierarchical and pivot grids too; the spec only exercises IgxGrid), igx-column-actions, igx-pivot-data-selector and igx-query-builder. The query builder covers the advanced filtering dialog, including when it's standalone or opened with custom overlay settings. The snackbar and the query builder buttons now havetype="button".

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

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 11:42

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 fix addresses the reported issue with regression coverage and no identified blockers; tests were not executed during review.

Review effort: Balanced
Findings: None

What changed in this PR

Addresses #17638 by preventing the snackbar’s default action button from acting as a form submit button.

Changes:

  • Adds type="button" to the default action button.
  • Adds a regression assertion for the button type.
  • Documents the fix in the changelog.
File Description
projects/​igniteui-angular/​snackbar/​src/​snackbar/​snackbar.component.spec.ts Verifies the explicit button type.
projects/​igniteui-angular/​snackbar/​src/​snackbar/​snackbar.component.html Sets the action button’s non-submit type.
CHANGELOG.md Records the form-submission fix.

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

@igdmdimitrov igdmdimitrov changed the title fix(snackbar): add type="button" fix(snackbar): add type="button" - 21.2.x Oct 7, 2026
@igdmdimitrov igdmdimitrov added 🛠️ status: in-development Issues and PRs with active development on them and removed ❌ status: awaiting-test PRs awaiting manual verification labels Nov 11, 2026
@igdmdimitrov igdmdimitrov changed the title fix(snackbar): add type="button" - 21.2.x fix(forms): prevent implicit form submission from grid - 21.2.x Nov 11, 2026
@igdmdimitrov igdmdimitrov added ❌ status: awaiting-test PRs awaiting manual verification and removed 🛠️ status: in-development Issues and PRs with active development on them labels Nov 11, 2026
@mddragnev mddragnev added ✅ status: verified Applies to PRs that have passed manual verification and removed ❌ status: awaiting-test PRs awaiting manual verification labels Nov 11, 2026

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

snackbar version: 21.2.x ✅ status: verified Applies to PRs that have passed manual verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants