From b29202e0b87d76e5a214552248f3336390059846 Mon Sep 17 00:00:00 2001 From: catepalmer Date: Thu, 17 Jan 2019 16:02:46 +1300 Subject: [PATCH] Make requested changes to fix typos and reword unclear descriptions --- demo/js/demo.tsx | 5 ++++- src/AccordionContainer/AccordionContainer.spec.tsx | 4 ++-- src/AccordionContainer/AccordionContainer.tsx | 1 - 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/demo/js/demo.tsx b/demo/js/demo.tsx index 18881d0c..d443b1b9 100644 --- a/demo/js/demo.tsx +++ b/demo/js/demo.tsx @@ -92,7 +92,10 @@ const Example = (): JSX.Element => ( allowMultipleExpanded Boolean false - Open only one item at a time or not + + Don't close all the others when expanding an + AccordionItem + onChange diff --git a/src/AccordionContainer/AccordionContainer.spec.tsx b/src/AccordionContainer/AccordionContainer.spec.tsx index dcca2192..9dacf24d 100644 --- a/src/AccordionContainer/AccordionContainer.spec.tsx +++ b/src/AccordionContainer/AccordionContainer.spec.tsx @@ -122,7 +122,7 @@ describe('Accordion', () => { ); }); - it("adding an expanded item to an accordion that doesn't allow mutliple expansions closes other items", () => { + it("adding an expanded item to an accordion that doesn't allow multiple expansions closes other items", () => { const mock = jest.fn(() => null); const instance = mount( { expect(console.error).toBeCalled(); }); - it("triggers 'onChange' with uuid when accordion doesn't allow mutiple expansions", () => { + it("triggers 'onChange' with uuid when accordion doesn't allow multiple expansions", () => { const onChange = jest.fn(); const item = { ...DEFAULT_ITEM, diff --git a/src/AccordionContainer/AccordionContainer.tsx b/src/AccordionContainer/AccordionContainer.tsx index 1243047f..7114d7ef 100644 --- a/src/AccordionContainer/AccordionContainer.tsx +++ b/src/AccordionContainer/AccordionContainer.tsx @@ -81,7 +81,6 @@ export class Provider extends React.Component { ); } if (!this.props.allowMultipleExpanded && newItem.expanded) { - // If this is a true accordion that doesn't allow multiple expansions and the new item is expanded, then the others must be closed. items = [ ...state.items.map((item: Item) => ({ ...item,