diff --git a/node.go b/node.go index 2d4aefa..0f2991e 100644 --- a/node.go +++ b/node.go @@ -220,7 +220,7 @@ func AriaHidden(n Node, hidden bool) Node { if hidden { return Attr(n, "aria-hidden", "true") } - return Attr(n, "aria-hidden", "false") + return n } // node.go: TabIndex sets the tabindex attribute on an element node. diff --git a/node_test.go b/node_test.go index b2a630b..37aa206 100644 --- a/node_test.go +++ b/node_test.go @@ -303,8 +303,8 @@ func TestAriaHiddenHelper(t *testing.T) { visible := AriaHidden(El("span", Raw("decorative")), false) gotVisible := visible.Render(ctx) - if !strings.Contains(gotVisible, `aria-hidden="false"`) { - t.Errorf("AriaHidden(false) = %q, want aria-hidden=\"false\"", gotVisible) + if strings.Contains(gotVisible, `aria-hidden=`) { + t.Errorf("AriaHidden(false) = %q, want no aria-hidden attribute", gotVisible) } }