Skip to content

Commit 84aebbb

Browse files
committed
fix(HeadlineEditor): Fix anchor position
The necessary css class was not present because we asked for many instead of any. But the level select is always present, just disabled for a single option
1 parent d187dd2 commit 84aebbb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/components/alchemy/ingredients/headline_editor.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def input_field
6161

6262
def css_classes
6363
super + [
64-
has_level_select? ? "with-level-select" : nil,
64+
level_options.any? ? "with-level-select" : nil,
6565
has_size_select? ? "with-size-select" : nil
6666
].compact
6767
end

spec/components/alchemy/ingredients/headline_editor_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@
4141
is_expected.to have_selector("sl-tooltip[content='Level']")
4242
end
4343

44-
context "and having many level options" do
44+
context "and having any level options" do
4545
before do
4646
allow(headline_editor).to receive(:level_options) do
47-
[["H1", 1], ["H2", 2]]
47+
[["H1", 1]]
4848
end
4949
end
5050

0 commit comments

Comments
 (0)