From 1b75ba3daebdfe0e6b8d5eb06b6579cc84abb418 Mon Sep 17 00:00:00 2001 From: "jiri.fencl" Date: Fri, 3 Aug 2018 21:19:24 +0200 Subject: [PATCH] fix: allow attribure "role" for component aria props --- src/UIComponentHelper.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/UIComponentHelper.js b/src/UIComponentHelper.js index 9267ad5..b6af7bf 100644 --- a/src/UIComponentHelper.js +++ b/src/UIComponentHelper.js @@ -148,7 +148,7 @@ export default class UIComponentHelper { /** * Filters the provided properties and returns only the properties which's - * names start with the {@code aria-} prefix. + * names start with the {@code aria-} prefix or role property. * * @param {Object} props * @return {Object} @@ -157,7 +157,7 @@ export default class UIComponentHelper { let ariaProps = {}; for (let propertyName of Object.keys(props)) { - if (/^aria-/.test(propertyName)) { + if (/^(aria-|role)/.test(propertyName)) { ariaProps[propertyName] = props[propertyName]; } }