+ Disabled provider
diff --git a/packages/dify-ui/src/combobox/index.tsx b/packages/dify-ui/src/combobox/index.tsx
index 33852d1a91..8f87b279ca 100644
--- a/packages/dify-ui/src/combobox/index.tsx
+++ b/packages/dify-ui/src/combobox/index.tsx
@@ -436,7 +436,7 @@ export function ComboboxEmpty({
}: BaseCombobox.Empty.Props) {
return (
)
diff --git a/packages/dify-ui/src/select/__tests__/index.spec.tsx b/packages/dify-ui/src/select/__tests__/index.spec.tsx
index 09450f56af..d1a89243b6 100644
--- a/packages/dify-ui/src/select/__tests__/index.spec.tsx
+++ b/packages/dify-ui/src/select/__tests__/index.spec.tsx
@@ -173,7 +173,7 @@ describe('Select wrappers', () => {
})
await expect.element(screen.getByRole('combobox', { name: 'city select' })).toHaveAttribute('data-readonly')
- expect(screen.getByRole('combobox', { name: 'city select' }).element().className).toContain('data-readonly:bg-transparent')
+ expect(screen.getByRole('combobox', { name: 'city select' }).element().className).toContain('data-readonly:bg-components-input-bg-normal')
})
it('should hide arrow icon via CSS when Root is readOnly', async () => {
@@ -319,6 +319,41 @@ describe('Select wrappers', () => {
await expect.element(screen.getByRole('option', { name: 'New York' })).toBeInTheDocument()
})
+ it('should navigate items with arrow keys', async () => {
+ const screen = await render(
+ ,
+ )
+
+ const trigger = asHTMLElement(screen.getByRole('combobox', { name: 'city select' }).element())
+
+ trigger.focus()
+ trigger.dispatchEvent(new KeyboardEvent('keydown', { key: 'ArrowDown', bubbles: true, cancelable: true }))
+ await expect.element(screen.getByRole('option', { name: 'Seattle' })).toHaveAttribute('data-highlighted')
+
+ const highlightedItem = asHTMLElement(screen.getByRole('option', { name: 'Seattle' }).element())
+ highlightedItem.dispatchEvent(new KeyboardEvent('keydown', { key: 'ArrowDown', bubbles: true, cancelable: true }))
+
+ await expect.element(screen.getByRole('option', { name: 'New York' })).toHaveAttribute('data-highlighted')
+ })
+
it('should not call onValueChange when disabled item is clicked', async () => {
const onValueChange = vi.fn()
diff --git a/packages/dify-ui/src/select/index.stories.tsx b/packages/dify-ui/src/select/index.stories.tsx
index 40461be199..62abb0048d 100644
--- a/packages/dify-ui/src/select/index.stories.tsx
+++ b/packages/dify-ui/src/select/index.stories.tsx
@@ -16,6 +16,11 @@ import {
const triggerWidth = 'w-64'
+const cityItems = [
+ { label: 'Seattle', value: 'seattle' },
+ { label: 'New York', value: 'new-york' },
+]
+
const meta = {
title: 'Base/Form/Select',
component: Select,
@@ -238,7 +243,7 @@ export const Disabled: Story = {
export const ReadOnly: Story = {
render: () => (
-