Skip to content

Commit 8e2f9a1

Browse files
committed
Merge branch 'allow-to-pass-strategy-option-to-dropdown-menu' of github.com:lsouoliveira/ruby_ui into allow-to-pass-strategy-option-to-dropdown-menu
2 parents 1b31533 + 2189098 commit 8e2f9a1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/ruby_ui/dropdown_menu/dropdown_menu.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def default_attrs
1717
{
1818
class: [
1919
"group/dropdown-menu",
20-
(@strategy == "absolute") ? "is-absolute" : "is-fixed"
20+
(strategy == "absolute") ? "is-absolute" : "is-fixed"
2121
],
2222
data: {
2323
controller: "ruby-ui--dropdown-menu",
@@ -26,5 +26,9 @@ def default_attrs
2626
}
2727
}
2828
end
29+
30+
def strategy
31+
@_strategy ||= @options[:strategy] || "absolute"
32+
end
2933
end
3034
end

0 commit comments

Comments
 (0)