Skip to content

fix(core): forward loading to json-render Button's underlying BaseButton - #497

Merged
antfu merged 2 commits into
vitejs:mainfrom
dvcolomban:fix/json-render-button-loading
Jul 31, 2026
Merged

antfu merged 2 commits into
vitejs:mainfrom
dvcolomban:fix/json-render-button-loading

Conversation

@dvcolomban

Copy link
Copy Markdown
Contributor

Summary

  • JrButton (json-render's Button catalog element) never read element.props.loading, so a spec-driven Button with loading: true silently dropped it — only disabled/icon actually reached the rendered button.
  • BaseButton (display/Button.vue) already fully supports loading (renders its spinner in place of the icon slot), it just wasn't wired through.
  • Adds loading?: boolean to ButtonProps, destructures it, and forwards it to BaseButton.
  • Adds a loading example to the JsonRender.stories.ts Gallery story (button stays icon-set to demonstrate that loading takes precedence and swaps in the spinner).

Test plan

  • pnpm run typecheck (vue-tsc -b)
  • pnpm eslint on the two changed files
  • pnpm run build:js + client build in packages/core
  • Visual check in Storybook (JsonRender/Gallery) — the added Deploying… button shows the spinner instead of its icon

JrButton's props/setup never read element.props.loading, so a spec-driven
Button with loading: true silently dropped it — only disabled/icon reached
the rendered button. BaseButton already fully supports loading (spinner in
place of the icon slot); this just wires the existing prop through.
@pkg-pr-new

pkg-pr-new Bot commented Jul 30, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@vitejs/devtools

npm i https://pkg.pr.new/@vitejs/devtools@497

@vitejs/devtools-kit

npm i https://pkg.pr.new/@vitejs/devtools-kit@497

@vitejs/devtools-oxc

npm i https://pkg.pr.new/@vitejs/devtools-oxc@497

@vitejs/devtools-rolldown

npm i https://pkg.pr.new/@vitejs/devtools-rolldown@497

@vitejs/devtools-vite

npm i https://pkg.pr.new/@vitejs/devtools-vite@497

@vitejs/devtools-vitest

npm i https://pkg.pr.new/@vitejs/devtools-vitest@497

commit: b522f3b

@antfu
antfu merged commit 7548327 into vitejs:main Jul 31, 2026
7 checks passed
@dvcolomban
dvcolomban deleted the fix/json-render-button-loading branch August 3, 2026 10:51
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.

2 participants