Skip to content

Commit 0719f7c

Browse files
authored
Fix disabled state for link (#4190)
Ruwnay https://runway.powerhrg.com/backlog_items/PLAY-1862 When using the link variant for our button kit, it is not properly applying the disabled prop. When disabled it is forced to use the button tag Maddie had the issue and reported it in the playbook room
1 parent e43cf01 commit 0719f7c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Diff for: playbook/app/pb_kits/playbook/pb_button/button.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def link_options
6565
end
6666

6767
def tag
68-
link ? "a" : "button"
68+
link && !disabled ? "a" : "button"
6969
end
7070

7171
def valid_emoji(icon)

Diff for: playbook/spec/pb_kits/playbook/kits/button_spec.rb

+3
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
it "returns 'a' when link is provided" do
3333
expect(subject.new(link: true).tag).to eq "a"
3434
end
35+
it "returns 'button' when link and disabled" do
36+
expect(subject.new(link: true, disabled: true).tag).to eq "button"
37+
end
3538
end
3639

3740
describe "#link_options" do

0 commit comments

Comments
 (0)