Skip to content

Commit

Permalink
disclosure: fix data attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
chaance committed Feb 13, 2020
1 parent 859144f commit 36a5302
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/disclosure/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
forwardRefWithAs,
makeId,
useForkedRef,
wrapEvent
wrapEvent,
} from "@reach/utils";
import { useId } from "@reach/auto-id";
import PropTypes from "prop-types";
Expand All @@ -37,7 +37,7 @@ const useDisclosureContext = () => useContext(DisclosureContext);

export enum DisclosureStates {
Open = "open",
Collapsed = "collapsed"
Collapsed = "collapsed",
}

////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -93,7 +93,7 @@ export const Disclosure: React.FC<DisclosureProps> = ({
disclosureId: id,
onSelect,
open,
panelId
panelId,
};

if (isControlled && openProp !== open) {
Expand Down Expand Up @@ -162,7 +162,7 @@ if (__DEV__) {
children: PropTypes.node.isRequired,
defaultOpen: PropTypes.bool,
onChange: PropTypes.func,
open: PropTypes.bool
open: PropTypes.bool,
};
}

Expand Down Expand Up @@ -207,7 +207,7 @@ export const DisclosureButton = forwardRefWithAs<
{...props}
ref={ref}
onClick={wrapEvent(onClick, handleClick)}
data-reach-disclosure-trigger=""
data-reach-disclosure-button=""
data-state={open ? DisclosureStates.Open : DisclosureStates.Collapsed}
>
{children}
Expand All @@ -234,7 +234,7 @@ if (__DEV__) {
DisclosureButton.displayName = "DisclosureButton";
DisclosureButton.propTypes = {
as: PropTypes.any,
children: PropTypes.node
children: PropTypes.node,
};
}

Expand Down

0 comments on commit 36a5302

Please sign in to comment.