Skip to content

Commit 749ec77

Browse files
Mamadukaclaude
andcommitted
Inserter: Pass button type to skip post-mount item re-render
Ariakit's useCommand re-renders each item after mount to detect a native button unless a type is set. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent a22ce64 commit 749ec77

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • packages/block-editor/src/components/inserter-listbox

‎packages/block-editor/src/components/inserter-listbox/item.jsx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ function InserterListboxItem(
1616
// Manage the roving tab index below. Otherwise every item
1717
// re-renders to update it once the items have registered.
1818
tabbable
19+
// Without an explicit type, every item re-renders after mount
20+
// once Ariakit detects the native button.
21+
type="button"
1922
{ ...props }
2023
render={ ( htmlProps ) => {
2124
const propsWithTabIndex = {

0 commit comments

Comments
 (0)