Skip to content

Commit 7fe0a90

Browse files
committed
[RUBY_UI] FIX Table + DELETE DropdownMenu strategy
1 parent ec4c623 commit 7fe0a90

File tree

4 files changed

+4
-15
lines changed

4 files changed

+4
-15
lines changed

lib/ruby_ui/dropdown_menu/dropdown_menu.rb

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,13 @@ def view_template(&)
1515

1616
def default_attrs
1717
{
18-
class: [
19-
"z-50",
20-
"group/dropdown-menu",
21-
(strategy == "absolute") ? "is-absolute" : "is-fixed"
22-
],
18+
class: "z-50",
2319
data: {
2420
controller: "ruby-ui--dropdown-menu",
2521
action: "click@window->ruby-ui--dropdown-menu#onClickOutside",
2622
ruby_ui__dropdown_menu_options_value: @options.to_json
2723
}
2824
}
2925
end
30-
31-
def strategy
32-
@_strategy ||= @options[:strategy] || "absolute"
33-
end
3426
end
3527
end

lib/ruby_ui/dropdown_menu/dropdown_menu_content.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@ def default_attrs
2121

2222
def wrapper_attrs
2323
{
24-
class: [
25-
"z-50 hidden group-[.is-absolute]/dropdown-menu:absolute",
26-
"group-[.is-fixed]/dropdown-menu:fixed"
27-
],
24+
class: "z-50 hidden absolute",
2825
data: {ruby_ui__dropdown_menu_target: "content"},
2926
style: {
3027
width: "max-content",

lib/ruby_ui/dropdown_menu/dropdown_menu_controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export default class extends Controller {
4545
computePosition(this.triggerTarget, this.contentTarget, {
4646
placement: this.optionsValue.placement || "top",
4747
middleware: [flip(), shift(), offset(8)],
48-
strategy: this.optionsValue.strategy || "absolute",
48+
strategy: "absolute",
4949
}).then(({ x, y }) => {
5050
Object.assign(this.contentTarget.style, {
5151
left: `${x}px`,

lib/ruby_ui/table/table.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
module RubyUI
44
class Table < Base
55
def view_template(&block)
6-
div(class: "relative w-full overflow-auto") do
6+
div(class: "relative w-full overflow-x-auto") do
77
table(**attrs, &block)
88
end
99
end

0 commit comments

Comments
 (0)