diff --git a/lib/ruby_ui/command/command_input.rb b/lib/ruby_ui/command/command_input.rb index 3c2460f3..7d8cfe9c 100644 --- a/lib/ruby_ui/command/command_input.rb +++ b/lib/ruby_ui/command/command_input.rb @@ -38,7 +38,12 @@ def input_container(&) def default_attrs { - class: "flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50", + class: [ + "flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none", + "placeholder:text-muted-foreground", + "disabled:cursor-not-allowed disabled:opacity-50", + "aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:pointer-events-none" + ], placeholder: @placeholder, data_action: "input->ruby-ui--command#filter keydown.down->ruby-ui--command#handleKeydown keydown.up->ruby-ui--command#handleKeydown keydown.enter->ruby-ui--command#handleKeydown keydown.esc->ruby-ui--command#dismiss", data_ruby_ui__command_target: "input", diff --git a/lib/ruby_ui/command/command_item.rb b/lib/ruby_ui/command/command_item.rb index 8b2c2aad..1d05c240 100644 --- a/lib/ruby_ui/command/command_item.rb +++ b/lib/ruby_ui/command/command_item.rb @@ -17,7 +17,14 @@ def view_template(&) def default_attrs { - class: "relative flex cursor-pointer select-none items-center gap-x-2 rounded-sm px-2 py-1.5 text-sm outline-none hover:bg-accent hover:text-accent-foreground aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", + class: [ + "relative flex cursor-pointer select-none items-center gap-x-2 rounded-sm px-2 py-1.5 text-sm outline-none", + "hover:bg-accent hover:text-accent-foreground", + "disabled:pointer-events-none disabled:opacity-50", + "aria-selected:bg-accent aria-selected:text-accent-foreground", + "data-[disabled]:pointer-events-none data-[disabled]:opacity-50", + "aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:pointer-events-none" + ], href: @href, role: "option", data: {