Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/ruby_ui/select/select_content.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def initialize(**attrs)
def view_template(&block)
div(**attrs) do
div(
class: "max-h-96 min-w-max overflow-auto rounded-md border bg-background p-1 text-foreground shadow-md animate-out group-data-[ruby-ui--select-open-value=true]/select:animate-in fade-out-0 group-data-[ruby-ui--select-open-value=true]/select:fade-in-0 zoom-out-95 group-data-[ruby-ui--select-open-value=true]/select:zoom-in-95 slide-in-from-top-2", &block
class: "max-h-96 w-full text-wrap overflow-auto rounded-md border bg-background p-1 text-foreground shadow-md animate-out group-data-[ruby-ui--select-open-value=true]/select:animate-in fade-out-0 group-data-[ruby-ui--select-open-value=true]/select:fade-in-0 zoom-out-95 group-data-[ruby-ui--select-open-value=true]/select:zoom-in-95 slide-in-from-top-2", &block
)
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/ruby_ui/select/select_controller.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Controller } from "@hotwired/stimulus";
import { computePosition, autoUpdate, offset } from "@floating-ui/dom";
import { computePosition, autoUpdate, offset, flip } from "@floating-ui/dom";

export default class extends Controller {
static targets = ["trigger", "content", "input", "value", "item"];
Expand Down Expand Up @@ -121,7 +121,7 @@ export default class extends Controller {
setFloatingElement() {
this.cleanup = autoUpdate(this.triggerTarget, this.contentTarget, () => {
computePosition(this.triggerTarget, this.contentTarget, {
middleware: [offset(4)],
middleware: [offset(4), flip()],
}).then(({ x, y }) => {
Object.assign(this.contentTarget.style, {
left: `${x}px`,
Expand Down
2 changes: 1 addition & 1 deletion lib/ruby_ui/select/select_value.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def default_attrs
data: {
ruby_ui__select_target: "value"
},
class: "pointer-events-none"
class: "truncate pointer-events-none"
}
end
end
Expand Down
Loading