Skip to content

Commit

Permalink
Merge pull request #270 from dabapps/collapse-fixes-v2-0.8.x
Browse files Browse the repository at this point in the history
Collapse fixes v2 0.8.x
  • Loading branch information
JakeSidSmith authored Sep 18, 2018
2 parents 6fc12e3 + c7736de commit f3e7aff
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 33 deletions.
5 changes: 4 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
"extends": [
"dabapps/base",
"dabapps/commonjs"
]
],
"rules": {
"prettier/prettier": 0
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dabapps/roe",
"version": "0.8.37",
"version": "0.8.38",
"description": "A Collection of React Components for Project Development",
"main": "dist/js/index.js",
"types": "dist/js/index.d.ts",
Expand Down Expand Up @@ -71,7 +71,7 @@
"enzyme-adapter-react-15": "1.0.5",
"enzyme-to-json": "3.2.2",
"eslint": "3.19.0",
"eslint-config-dabapps": "github:dabapps/eslint-config-dabapps",
"eslint-config-dabapps": "github:dabapps/eslint-config-dabapps#v4.0.0",
"http-server": "0.9.0",
"jest": "20.0.3",
"less-loader": "4.0.5",
Expand Down
4 changes: 2 additions & 2 deletions src/ts/components/collapse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export class Collapse extends PureComponent<CollapseProps, CollapseState> {
fadeHeight = DEFAULT_FADE_HEIGHT,
open,
maxCollapsedHeight,
minHeight = 'auto',
minHeight = null,
animationDuration = DEFAULT_DURATION,
component: Component = 'div',
...remainingProps
Expand All @@ -132,7 +132,7 @@ export class Collapse extends PureComponent<CollapseProps, CollapseState> {

const collapseStyle = {
minHeight,
maxHeight: opened ? 'auto' : height,
maxHeight: opened ? null : height,
position: 'relative' as 'relative',
overflow: 'hidden' as 'hidden',
transition: `ease-in-out ${animationDuration}ms max-height`
Expand Down
56 changes: 28 additions & 28 deletions tests/__snapshots__/collapse.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ exports[`Collapse should close to custom height 1`] = `
className="clearfix collapse collapse-open"
style={
Object {
"maxHeight": "auto",
"minHeight": "auto",
"maxHeight": null,
"minHeight": null,
"overflow": "hidden",
"position": "relative",
"transition": "ease-in-out 200ms max-height",
Expand All @@ -32,7 +32,7 @@ exports[`Collapse should close to custom height 2`] = `
style={
Object {
"maxHeight": 500,
"minHeight": "auto",
"minHeight": null,
"overflow": "hidden",
"position": "relative",
"transition": "ease-in-out 200ms max-height",
Expand Down Expand Up @@ -68,7 +68,7 @@ exports[`Collapse should close to custom height 3`] = `
style={
Object {
"maxHeight": 100,
"minHeight": "auto",
"minHeight": null,
"overflow": "hidden",
"position": "relative",
"transition": "ease-in-out 200ms max-height",
Expand Down Expand Up @@ -104,7 +104,7 @@ exports[`Collapse should close to custom height 4`] = `
style={
Object {
"maxHeight": 100,
"minHeight": "auto",
"minHeight": null,
"overflow": "hidden",
"position": "relative",
"transition": "ease-in-out 200ms max-height",
Expand Down Expand Up @@ -138,8 +138,8 @@ exports[`Collapse should close to default height 1`] = `
className="clearfix collapse collapse-open"
style={
Object {
"maxHeight": "auto",
"minHeight": "auto",
"maxHeight": null,
"minHeight": null,
"overflow": "hidden",
"position": "relative",
"transition": "ease-in-out 200ms max-height",
Expand All @@ -159,7 +159,7 @@ exports[`Collapse should close to default height 2`] = `
style={
Object {
"maxHeight": 500,
"minHeight": "auto",
"minHeight": null,
"overflow": "hidden",
"position": "relative",
"transition": "ease-in-out 200ms max-height",
Expand Down Expand Up @@ -194,7 +194,7 @@ exports[`Collapse should close to default height 3`] = `
style={
Object {
"maxHeight": 0,
"minHeight": "auto",
"minHeight": null,
"overflow": "hidden",
"position": "relative",
"transition": "ease-in-out 200ms max-height",
Expand Down Expand Up @@ -229,7 +229,7 @@ exports[`Collapse should close to default height 4`] = `
style={
Object {
"maxHeight": 0,
"minHeight": "auto",
"minHeight": null,
"overflow": "hidden",
"position": "relative",
"transition": "ease-in-out 200ms max-height",
Expand Down Expand Up @@ -260,7 +260,7 @@ exports[`Collapse should match snapshot when collapsed 1`] = `
style={
Object {
"maxHeight": 0,
"minHeight": "auto",
"minHeight": null,
"overflow": "hidden",
"position": "relative",
"transition": "ease-in-out 200ms max-height",
Expand All @@ -274,8 +274,8 @@ exports[`Collapse should match snapshot when expanded 1`] = `
className="clearfix collapse collapse-open"
style={
Object {
"maxHeight": "auto",
"minHeight": "auto",
"maxHeight": null,
"minHeight": null,
"overflow": "hidden",
"position": "relative",
"transition": "ease-in-out 200ms max-height",
Expand All @@ -290,7 +290,7 @@ exports[`Collapse should match snapshot with custom animation duration 1`] = `
style={
Object {
"maxHeight": 0,
"minHeight": "auto",
"minHeight": null,
"overflow": "hidden",
"position": "relative",
"transition": "ease-in-out 100ms max-height",
Expand All @@ -305,7 +305,7 @@ exports[`Collapse should match snapshot with custom collapsed height 1`] = `
style={
Object {
"maxHeight": 100,
"minHeight": "auto",
"minHeight": null,
"overflow": "hidden",
"position": "relative",
"transition": "ease-in-out 200ms max-height",
Expand Down Expand Up @@ -335,7 +335,7 @@ exports[`Collapse should match snapshot with customized fade out 1`] = `
style={
Object {
"maxHeight": 0,
"minHeight": "auto",
"minHeight": null,
"overflow": "hidden",
"position": "relative",
"transition": "ease-in-out 200ms max-height",
Expand Down Expand Up @@ -365,7 +365,7 @@ exports[`Collapse should match snapshot with fade out 1`] = `
style={
Object {
"maxHeight": 0,
"minHeight": "auto",
"minHeight": null,
"overflow": "hidden",
"position": "relative",
"transition": "ease-in-out 200ms max-height",
Expand Down Expand Up @@ -400,7 +400,7 @@ exports[`Collapse should open from custom height 1`] = `
style={
Object {
"maxHeight": 100,
"minHeight": "auto",
"minHeight": null,
"overflow": "hidden",
"position": "relative",
"transition": "ease-in-out 200ms max-height",
Expand Down Expand Up @@ -436,7 +436,7 @@ exports[`Collapse should open from custom height 2`] = `
style={
Object {
"maxHeight": 100,
"minHeight": "auto",
"minHeight": null,
"overflow": "hidden",
"position": "relative",
"transition": "ease-in-out 200ms max-height",
Expand Down Expand Up @@ -472,7 +472,7 @@ exports[`Collapse should open from custom height 3`] = `
style={
Object {
"maxHeight": 500,
"minHeight": "auto",
"minHeight": null,
"overflow": "hidden",
"position": "relative",
"transition": "ease-in-out 200ms max-height",
Expand Down Expand Up @@ -507,8 +507,8 @@ exports[`Collapse should open from custom height 4`] = `
className="clearfix collapse collapse-open"
style={
Object {
"maxHeight": "auto",
"minHeight": "auto",
"maxHeight": null,
"minHeight": null,
"overflow": "hidden",
"position": "relative",
"transition": "ease-in-out 200ms max-height",
Expand All @@ -528,7 +528,7 @@ exports[`Collapse should open from default height 1`] = `
style={
Object {
"maxHeight": 0,
"minHeight": "auto",
"minHeight": null,
"overflow": "hidden",
"position": "relative",
"transition": "ease-in-out 200ms max-height",
Expand Down Expand Up @@ -563,7 +563,7 @@ exports[`Collapse should open from default height 2`] = `
style={
Object {
"maxHeight": 0,
"minHeight": "auto",
"minHeight": null,
"overflow": "hidden",
"position": "relative",
"transition": "ease-in-out 200ms max-height",
Expand Down Expand Up @@ -598,7 +598,7 @@ exports[`Collapse should open from default height 3`] = `
style={
Object {
"maxHeight": 500,
"minHeight": "auto",
"minHeight": null,
"overflow": "hidden",
"position": "relative",
"transition": "ease-in-out 200ms max-height",
Expand Down Expand Up @@ -632,8 +632,8 @@ exports[`Collapse should open from default height 4`] = `
className="clearfix collapse collapse-open"
style={
Object {
"maxHeight": "auto",
"minHeight": "auto",
"maxHeight": null,
"minHeight": null,
"overflow": "hidden",
"position": "relative",
"transition": "ease-in-out 200ms max-height",
Expand All @@ -649,7 +649,7 @@ exports[`Collapse should take regular element attributes 1`] = `
style={
Object {
"maxHeight": 0,
"minHeight": "auto",
"minHeight": null,
"overflow": "hidden",
"position": "relative",
"transition": "ease-in-out 200ms max-height",
Expand Down

0 comments on commit f3e7aff

Please sign in to comment.