Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: standalone action disabled and enabled classes #3520

Merged
merged 4 commits into from
Dec 13, 2024
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 app/components/avo/button_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def args
end

def button_classes
classes = "button-component inline-flex flex-grow-0 items-center font-semibold leading-6 fill-current whitespace-nowrap transition duration-100 transform transition duration-100 cursor-pointer disabled:cursor-not-allowed disabled:opacity-70 justify-center #{@class}"
classes = "button-component inline-flex flex-grow-0 items-center font-semibold leading-6 fill-current whitespace-nowrap transition duration-100 transform transition duration-100 cursor-pointer disabled:cursor-not-allowed disabled:opacity-60 data-[disabled='true']:opacity-60 justify-center #{@class}"

# For non-icon-styled buttons we should not add borders.
classes += " border active:outline active:outline-1" unless is_icon?
Expand Down
3 changes: 2 additions & 1 deletion app/components/avo/resource_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,8 @@ def render_action(action)
tippy: action.title ? :tooltip : nil,
action: "click->actions-picker#visitAction",
turbo_prefetch: false,
"actions-picker-target": action.action.standalone ? "standaloneAction" : "resourceAction",
# When action has record present behave as standalone and keep always active.
"actions-picker-target": (action.action.standalone || action.action.record.present?) ? "standaloneAction" : "resourceAction",
disabled: action.action.disabled?
} do
action.label
Expand Down
Loading