Skip to content

Commit 6c62582

Browse files
gmsalustan3216
andauthored
* Fix: Item's size changes when hiding/displaying it again in responsive mode (closes jbaysolutions#431) Co-authored-by: lululala <[email protected]>
1 parent c4c58b5 commit 6c62582

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/components/GridItem.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
<script>
8989
import {setTopLeft, setTopRight, setTransformRtl, setTransform} from '@/helpers/utils';
9090
import {getControlPosition, createCoreData} from '@/helpers/draggableUtils';
91+
import {getColsFromBreakpoint} from '@/helpers/responsiveUtils';
9192
import {getDocumentDir} from "@/helpers/DOM";
9293
// var eventBus = require('./eventBus');
9394
@@ -302,11 +303,16 @@
302303
}
303304
},
304305
mounted: function () {
305-
this.cols = this.layout.colNum;
306+
if (this.layout.responsive) {
307+
this.cols = getColsFromBreakpoint(this.layout.lastBreakpoint, this.layout.cols);
308+
} else {
309+
this.cols = this.layout.colNum;
310+
}
306311
this.rowHeight = this.layout.rowHeight;
307312
this.containerWidth = this.layout.width !== null ? this.layout.width : 100;
308313
this.margin = this.layout.margin !== undefined ? this.layout.margin : [10, 10];
309314
this.maxRows = this.layout.maxRows;
315+
310316
if (this.isDraggable === null) {
311317
this.draggable = this.layout.isDraggable;
312318
} else {

0 commit comments

Comments
 (0)