Skip to content

Commit

Permalink
fix(tile): check if is--expanded is set when tile component is loaded (
Browse files Browse the repository at this point in the history
  • Loading branch information
tw15egan authored and asudoh committed May 23, 2018
1 parent 4ed416c commit 323b0ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/tile/_tile.scss
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
transition: $transition--base $carbon--standard-easing;

.#{$prefix}--tile__chevron svg {
transform: rotate(-180deg) translateY(4px);
transform: rotate(-180deg);
}

.#{$prefix}--tile-content__below-the-fold {
Expand Down
5 changes: 5 additions & 0 deletions src/components/tile/tile.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ class Tile extends mixin(createComponent, initComponentBySearch) {
this.atfHeight = aboveTheFold.getBoundingClientRect().height + tilePadding;
this.element.style.maxHeight = `${this.atfHeight}px`;
}

if (this.element.classList.contains(this.options.classExpandedTile)) {
this._setTileHeight();
}
}

this.element.addEventListener('click', evt => {
const input = eventMatches(evt, this.options.selectorTileInput);
if (!input) {
Expand Down

0 comments on commit 323b0ce

Please sign in to comment.