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: SVG breaks buton in Safari #3397

Merged
merged 2 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 1 addition & 3 deletions app/components/avo/button_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,9 @@ def is_not_icon?

def full_content
result = ""
icon_classes = @icon_class
# space out the icon from the text if text is present
icon_classes += " mr-1" if content.present? && is_not_icon?
# add the icon height
icon_classes += icon_size_classes
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix was to add pointer-events-none on the SVG element.

icon_classes = class_names(@icon_class, "pointer-events-none", icon_size_classes, "mr-1": content.present? && is_not_icon?)

# Add the icon
result += helpers.svg(@icon, class: icon_classes) if @icon.present?
Expand Down
4 changes: 2 additions & 2 deletions app/javascript/js/controllers/loading_button_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default class extends Controller {
<div class="button-spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
</div>`;
</div>`

static values = {
confirmationMessage: String,
Expand Down Expand Up @@ -52,6 +52,6 @@ export default class extends Controller {
const { button } = this

button.innerHTML = button.getAttribute('data-original-content')
button.removeAttribute('disabled');
button.removeAttribute('disabled')
}
}
Loading