Skip to content

Commit 5321400

Browse files
committed
Locked not working as expected
* fix #2981
1 parent 30d9cd2 commit 5321400

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

doc/CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ Change log
128128
* fix: [#2980](https://github.com/gridstack/gridstack.js/issues/2980) dd-touch circular dependency
129129
* fix: [#2667](https://github.com/gridstack/gridstack.js/issues/2667) sidebar items not honoring gs-w (enter-leave-re-enter)
130130
* fix: [#2987](https://github.com/gridstack/gridstack.js/issues/2987) gs-size-to-content to support numbers
131+
* fix: [#2981](https://github.com/gridstack/gridstack.js/issues/2981) Locked not working as expected
131132

132133
## 11.4.0 (2025-02-27)
133134
* fix: [#2921](https://github.com/gridstack/gridstack.js/pull/2921) replace initMouseEvent with MouseEvent constructor and added composed: true

src/gridstack.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -2459,14 +2459,16 @@ export class GridStack {
24592459
const noResize = node.noResize || this.opts.disableResize;
24602460

24612461
// check for disabled grid first
2462-
const disable = this.opts.staticGrid || (noMove && noResize);
2462+
const disable = node.locked || this.opts.staticGrid || (noMove && noResize);
24632463
if (force || disable) {
24642464
if (node._initDD) {
24652465
this._removeDD(el); // nukes everything instead of just disable, will add some styles back next
24662466
delete node._initDD;
24672467
}
2468-
if (disable) el.classList.add('ui-draggable-disabled', 'ui-resizable-disabled'); // add styles one might depend on #1435
2469-
if (!force) return this;
2468+
if (disable) {
2469+
el.classList.add('ui-draggable-disabled', 'ui-resizable-disabled'); // add styles one might depend on #1435
2470+
return this;
2471+
}
24702472
}
24712473

24722474
if (!node._initDD) {

0 commit comments

Comments
 (0)