Skip to content

Commit b30b7df

Browse files
Fix body margin shifting with modals, fix error on project column edit (#30831)
Fixes: #30816, regression from #30723. Fixes: #30815, regression from #30723. Fomantic [expects a callback](https://github.com/fomantic/Fomantic-UI/blob/59d9b409879ad9413ea0a3efa4ab2e51017ad9b9/src/definitions/modules/modal.js#L530-L534) to be called during `hide` which we did not do, so it could never remove the margin it added to `body`. I do observe the body content shifting to right by 1px when modal opens, but this is a bug that existed on v1.21 as well, so not a regression. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
1 parent c445a85 commit b30b7df

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

web_src/js/modules/fomantic/dimmer.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ import {queryElemChildren} from '../../utils/dom.js';
33

44
export function initFomanticDimmer() {
55
// stand-in for removed dimmer module
6-
$.fn.dimmer = function (arg0, $el) {
6+
$.fn.dimmer = function (arg0, arg1) {
77
if (arg0 === 'add content') {
8+
const $el = arg1;
89
const existingDimmer = document.querySelector('body > .ui.dimmer');
910
if (existingDimmer) {
10-
queryElemChildren(existingDimmer, '*', (el) => el.remove());
11+
queryElemChildren(existingDimmer, '*', (el) => el.classList.add('hidden'));
1112
this._dimmer = existingDimmer;
1213
} else {
1314
this._dimmer = document.createElement('div');
@@ -21,8 +22,10 @@ export function initFomanticDimmer() {
2122
this._dimmer.classList.add('active');
2223
document.body.classList.add('tw-overflow-hidden');
2324
} else if (arg0 === 'hide') {
25+
const cb = arg1;
2426
this._dimmer.classList.remove('active');
2527
document.body.classList.remove('tw-overflow-hidden');
28+
cb();
2629
}
2730
return this;
2831
};

0 commit comments

Comments
 (0)