From 0a4e4529268afddf262324aadeb7c4c59ba89502 Mon Sep 17 00:00:00 2001 From: Tim McCabe Date: Sat, 4 Feb 2023 10:03:02 -0500 Subject: [PATCH] Handle dynamic roles --- src/compiler/compile/nodes/Element.ts | 5 +++-- .../input.svelte | 5 +++++ .../warnings.json | 20 +++++++++---------- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/compiler/compile/nodes/Element.ts b/src/compiler/compile/nodes/Element.ts index 3ab6a2251518..5cc44ce15f87 100644 --- a/src/compiler/compile/nodes/Element.ts +++ b/src/compiler/compile/nodes/Element.ts @@ -764,10 +764,11 @@ export default class Element extends Node { }); } + const has_dynamic_role = attribute_map.get('role') && !attribute_map.get('role').is_static; + // no-static-element-interactions - // TODO: investigate footer - // TODO: investigate dynamic roles if ( + !has_dynamic_role && !is_hidden_from_screen_reader(this.name, attribute_map) && !is_presentation_role(role) && !is_interactive_element(this.name, attribute_map) && diff --git a/test/validator/samples/a11y-no-static-element-interactions/input.svelte b/test/validator/samples/a11y-no-static-element-interactions/input.svelte index 90d4669252a0..96b5c369cc01 100644 --- a/test/validator/samples/a11y-no-static-element-interactions/input.svelte +++ b/test/validator/samples/a11y-no-static-element-interactions/input.svelte @@ -1,9 +1,14 @@ + +