From 7f1100c44de03255e9ee153572425553ddd9e103 Mon Sep 17 00:00:00 2001 From: KgTong Date: Thu, 10 May 2018 13:40:46 +0800 Subject: [PATCH] fix(WAI-ARIA): make aria-expanded prop valid in preact Preact will ignore the prop which value is boolean false Convert the value to string can avoid this problem --- HISTORY.md | 4 ++++ package.json | 2 +- src/Panel.jsx | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 87fe41d..7dfb41b 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,6 +1,10 @@ # History ---- +## 1.9.1 2018-05-10 + +- Fix invalid aria-expanded prop in preact + ## 1.9.0 2018-04-02 - Add keyboard support [#84](https://github.com/react-component/collapse/pull/84) diff --git a/package.json b/package.json index 1050e11..978141d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rc-collapse", - "version": "1.9.0", + "version": "1.9.1", "description": "rc-collapse ui component for react", "keywords": [ "react", diff --git a/src/Panel.jsx b/src/Panel.jsx index aa51bc6..3eb11e8 100644 --- a/src/Panel.jsx +++ b/src/Panel.jsx @@ -49,7 +49,7 @@ class CollapsePanel extends Component { onClick={this.handleItemClick} role={accordion ? 'tab' : 'button'} tabIndex={disabled ? -1 : 0} - aria-expanded={isActive} + aria-expanded={`${isActive}`} onKeyPress={this.handleKeyPress} > {showArrow && }