Skip to content

Commit

Permalink
fix(tile): update props to remove errors, update tile maxheight (#4630)
Browse files Browse the repository at this point in the history
  • Loading branch information
jendowns authored and asudoh committed Nov 16, 2019
1 parent ceab6e0 commit cc362ff
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions packages/react/src/components/Tile/Tile.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,8 @@ export class ExpandableTile extends Component {
static defaultProps = {
tabIndex: 0,
expanded: false,
tileMaxHeight: '0',
tileMaxHeight: 0,
tilePadding: 0,
onBeforeClick: () => true,
handleClick: () => {},
tileCollapsedIconText: 'Interact to expand Tile',
Expand Down Expand Up @@ -503,29 +504,31 @@ export class ExpandableTile extends Component {
const {
tabIndex,
className,
expanded, // eslint-disable-line
tileMaxHeight, // eslint-disable-line
tilePadding, // eslint-disable-line
handleClick, // eslint-disable-line
tileCollapsedIconText, // eslint-disable-line
tileExpandedIconText, // eslint-disable-line
onBeforeClick, // eslint-disable-line
light,
...other
} = this.props;

const { expanded } = this.state;
const { expanded: isExpanded } = this.state;

const classes = classNames(
`${prefix}--tile`,
`${prefix}--tile--expandable`,
{
[`${prefix}--tile--is-expanded`]: expanded,
[`${prefix}--tile--is-expanded`]: isExpanded,
[`${prefix}--tile--light`]: light,
},
className
);

const tileStyle = {
maxHeight: expanded
maxHeight: isExpanded
? null
: this.state.tileMaxHeight + this.state.tilePadding,
};
Expand Down Expand Up @@ -556,8 +559,10 @@ export class ExpandableTile extends Component {
{childrenAsArray[0]}
</div>
<button
aria-expanded={expanded}
aria-label={expanded ? tileExpandedIconText : tileCollapsedIconText}
aria-expanded={isExpanded}
aria-label={
isExpanded ? tileExpandedIconText : tileCollapsedIconText
}
className={`${prefix}--tile__chevron`}>
<ChevronDown16 />
</button>
Expand Down

0 comments on commit cc362ff

Please sign in to comment.