Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

fix(CommandPalette): forward rest props to Dialog (#4288)

Cindy Zhang374af93241cc
diff --git a/.changeset/commandpalette-forward-rest.md b/.changeset/commandpalette-forward-rest.md
new file mode 100644
index 0000000000..ce66e100a7
--- /dev/null
+++ b/.changeset/commandpalette-forward-rest.md
@@ -0,0 +1,6 @@
+---
+'@astryxdesign/core': patch
+---
+
+[fix] CommandPalette: forward BaseProps pass-through attributes (className, style, xstyle, data-_, aria-_) to the underlying Dialog. Previously these were silently dropped.
+@cixzhang
diff --git a/packages/core/src/CommandPalette/CommandPalette.tsx b/packages/core/src/CommandPalette/CommandPalette.tsx
index a8a3b59525..689b206a25 100644
--- a/packages/core/src/CommandPalette/CommandPalette.tsx
+++ b/packages/core/src/CommandPalette/CommandPalette.tsx
@@ -268,6 +268,7 @@ export function CommandPalette<T extends SearchableItem = SearchableItem>({
label: labelFromProps,
width = 640,
maxHeight = 480,
+ ...rest
}: CommandPaletteProps<T>) {
const t = useTranslator();
const label = labelFromProps ?? t('@astryx.commandPalette.label');
@@ -527,7 +528,8 @@ export function CommandPalette<T extends SearchableItem = SearchableItem>({
width={width}
maxHeight={maxHeight}
purpose="info"
- aria-label={label}>
+ aria-label={label}
+ {...rest}>
<CommandPaletteContext value={contextValue}>
<Layout
defaultHasDividers