Skip to content

fix(workspace-search): set search buttons to type='button'#2748

Merged
mikeharv merged 2 commits into
RaspberryPiFoundation:mainfrom
AysajanE:fix/2510
Jul 13, 2026
Merged

fix(workspace-search): set search buttons to type='button'#2748
mikeharv merged 2 commits into
RaspberryPiFoundation:mainfrom
AysajanE:fix/2510

Conversation

@AysajanE

Copy link
Copy Markdown
Contributor

Fixes #2510.

The workspace-search next/previous/close buttons are created by the private createBtn helper without an explicit type, so each <button> defaults to type="submit". When a Blockly workspace is embedded in a <form>, clicking any of them submits the form — exactly as @admalledd reported, along with the one-line fix.

Change

  • createBtn now sets btn.type = 'button'. This single helper backs all three buttons (next, previous, close), so one line covers every case.
  • Added a createBtn() regression test asserting the three buttons expose type === 'button'. It fails on current main (jsdom reports the default 'submit') and passes with the fix.

Checks (Node 22)

  • npm run build --workspace=@blockly/plugin-workspace-search — OK
  • npm run test --workspace=@blockly/plugin-workspace-search — 17 passing
  • npm run lint and npm run format:check — clean

Thanks to @admalledd for the report and the suggested fix.


Disclosure: this change was prepared with AI assistance and reviewed by me before submitting. I ran the checks above in a network-isolated container and published a signed, re-runnable record of that run: https://northset-oss.github.io/verification-pilot/. Contributor self-run — not a maintainer verification.

@AysajanE
AysajanE requested a review from a team as a code owner July 12, 2026 02:18
@AysajanE
AysajanE requested review from mikeharv and removed request for a team July 12, 2026 02:18
@mikeharv
mikeharv merged commit 62ce120 into RaspberryPiFoundation:main Jul 13, 2026
11 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

workspace-search buttons need type=button

2 participants