Skip to content

[SCF-2415] [Part 10] Fix modal footer submission and BsAlert @visible regressions - #15

Merged
Gaurav0 merged 6 commits into
gaurav/chore/SCF-2415-part-9-refresh-remaining-depsfrom
gaurav/chore/SCF-2415-part-10-fix-modal-footer-and-alert
Nov 5, 2026
Merged

Gaurav0 merged 6 commits into
gaurav/chore/SCF-2415-part-9-refresh-remaining-depsfrom
gaurav/chore/SCF-2415-part-10-fix-modal-footer-and-alert

Conversation

@Gaurav0

@Gaurav0 Gaurav0 commented Nov 3, 2026

Copy link
Copy Markdown

Summary

Fixes for behavior that is already on scf_master, found while reviewing the SCF-2416 work. They don't depend on any dependency upgrade, so they ship in 4.10.3 rather than waiting for 5.0.0. These are behavior fixes, not vulnerability fixes.

  • Modal footer: custom @buttonComponent submits again. Since f005cd0 the submit button set its type with @buttonType="submit", which only BsButton understands. A custom button component ignored it, so @onSubmit never ran. The footer now passes type="submit" as an HTML attribute instead.
  • Modal footer: native form submission is kept unless @onSubmit handles it. 6c23b4c made the footer <form> always call preventDefault(), which also blocked a standalone footer without @onSubmit and a footer with an action attribute. The footer now only prevents the default when @onSubmit is given and the form has no action.
  • BsAlert: @visible={{null}} hides the alert again. 8945d07 (upstream Refactor bs-alert to remove @localCopy and avoid mutation after consumption error in Ember canary ember-bootstrap/ember-bootstrap#2027) treated null like undefined and showed the alert.
  • BsAlert: follows @visible in the same render. 8945d07 copied @visible into tracked state from a did-update modifier, so each change took an extra render before the fade started. Visibility is now resolved in the getter, which keeps Refactor bs-alert to remove @localCopy and avoid mutation after consumption error in Ember canary ember-bootstrap/ember-bootstrap#2027's dismiss behavior without writing tracked state during render.
  • BsForm test: "it does not catch errors thrown by onSubmit action" was skipped everywhere (7b53aa7) for an Embroider-only failure. It is now skipped only under Embroider, so classic builds check it again.
  • CI: runs on push only for scf_master and tags. Until now, each push to a branch with an open PR ran the full matrix twice. PRs are still covered by the pull_request: '**' trigger from Part 1 (b057803).

No dependency or yarn.lock changes.

Version

No version bump in this part. Part 9 already sets the version to 4.10.3, and v4.10.3 isn't tagged yet, so these fixes ship in 4.10.3. Tag after this part merges.

Stack

Part of the SCF-2415 work. This is part 10 of 10. Stacked on Part 9: its base is gaurav/chore/SCF-2415-part-9-refresh-remaining-deps, so the diff only shows this part. Merge in order.

Part PR Title
1 #6 Drop Node 16, require Node 18
2 #7 Remove release-it and release-it-lerna-changelog
3 #8 Move API docs tooling into docs/
4 #9 Dedupe Ember tooling (ember-auto-import 2, ember-source-channel-url 3)
5 #10 Upgrade Babel to 7.29 and force browserslist 4.29.5
6 #11 Force patched tmp, brace-expansion, minimatch, picomatch and braces
7 #12 Force patched fast-uri, nanoid, markdown-it, lodash.template and ansi-html
8 #13 Refresh dev-server and networking dependencies
9 #14 Refresh remaining vulnerable dependencies
10 this PR Fix modal footer submission and BsAlert @visible regressions

The SCF-2416 stack will be based on this part.

Review notes

Each commit is one fix with its own tests, and each commit message explains the cause. The BsAlert change in "follow BsAlert's @visible in the same render" needs the closest look. onDismissed without a fade now runs from the afterRender queue rather than from the modifier.

Testing

Run on this branch with Node 18: yarn install --frozen-lockfile passes, yarn lint reports 0 errors, and ember test (Ember 3.28) has 532 passed, 9 skipped and 0 failed. Part 9 had 526 passed and 10 skipped: this part adds 5 tests and un-skips 1. CI covers the ember-try matrix.

🤖 Generated with Claude Code

Gaurav0 and others added 6 commits November 3, 2026 08:30
With push on every branch and pull_request on every base branch, each
push to a branch with an open PR ran the full matrix twice. PRs are
still covered by the pull_request trigger, which uses '**' so stacked
PRs on gaurav/chore/... bases run (b057803).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he type attribute

Since f005cd0 the default submit button set its type with
@buttonType="submit", which only BsButton understands. A custom
@buttonComponent that renders <button type="button" ...attributes>
ignored it, so its clicks never submitted the footer form and
@onsubmit never ran. Before f005cd0, onClick={{@onsubmit}} reached any
button component through ...attributes.

Pass type="submit" as an HTML attribute instead. BsButton applies
...attributes after its own type, so it still renders a submit button,
and @buttonType is deprecated anyway.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…andles it

6c23b4c made the footer <form> always call preventDefault() on submit,
to stop the page reload when its submit button calls @onsubmit. That
also blocked native submission where it used to happen: a standalone
footer without @onsubmit, and a footer given an action attribute
(e.g. <modal.footer action="/export" method="post">).

Only prevent the default when @onsubmit is given and the form has no
action attribute. That still covers the reload in BsModal, where the
footer always gets onSubmit and no action.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
8945d07 (upstream ember-bootstrap#2027) replaced `@arg visible = true` with
`this._visible ?? true`, so @visible={{null}} (e.g. an unset model
attribute) now shows the alert. @arg only falls back to its default for
undefined, so null used to hide it. Fall back for undefined only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
8945d07 copied @visible into the tracked _visible from a
{{did-update this.updateVisibility @visible}} modifier. Writing it
during modifier commit schedules a second render, and only that render
runs {{did-update this.showOrHide this._visible}}, so each @visible
change took an extra render pass before the fade started.

Resolve visibility in the visible getter instead. A dismissal records
how often @visible had changed at the time (_dismissedAt), and holds
until @visible changes again, which the getter counts in untracked
fields. That keeps ember-bootstrap#2027's behavior (dismiss doesn't touch @visible,
and setting @visible to false and back to true shows the alert again)
without writing tracked state while rendering, which is what broke
@localcopy on Ember canary.

showOrHide's did-update now reads @visible itself, so without a fade
onDismissed is called from the afterRender queue instead of from the
modifier: a handler that sets @visible (as in ember-bootstrap#2027's test) would
otherwise update a value that render has already used. With a fade it
was already called later, from a timer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ly under Embroider

7b53aa7 skipped it everywhere for an Embroider-only failure
(ember-bootstrap#1682), so classic builds stopped checking
that BsForm doesn't swallow errors thrown by @onsubmit. Skip it only
when @embroider/core is installed, the check @embroider/test-setup's
maybeEmbroider uses to build with Embroider.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Joeu Joeu added Needs QA This PR needs QA before merging and removed Ready for Review labels Nov 4, 2026
@Gaurav0
Gaurav0 merged commit ee88a0f into gaurav/chore/SCF-2415-part-9-refresh-remaining-deps Nov 5, 2026
152 of 157 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Needs QA This PR needs QA before merging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants