Skip to content

Commit 11ba779

Browse files
author
marker dao ®
committed
fix()
1 parent 8f629a3 commit 11ba779

File tree

7 files changed

+29
-25
lines changed

7 files changed

+29
-25
lines changed

packages/devextreme/js/__internal/ui/m_action_sheet.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,7 @@ class ActionSheet extends CollectionWidget<Properties> {
169169
target: this.option('target'),
170170
}));
171171

172-
this._popup.$overlayContent().attr('role', 'dialog');
173-
172+
this._popup.$overlayContent()?.attr('role', 'dialog');
174173
this._popup.$wrapper()?.addClass(ACTION_SHEET_POPOVER_WRAPPER_CLASS);
175174
}
176175

@@ -250,16 +249,19 @@ class ActionSheet extends CollectionWidget<Properties> {
250249

251250
if (this.option('showCancelButton')) {
252251
const cancelClickAction = this._createActionByOption('onCancelClick') || noop;
253-
const that = this;
254-
255-
this._$cancelButton = $('<div>').addClass(ACTION_SHEET_CANCEL_BUTTON_CLASS);
256252

257253
const $content = this._popup?.$content();
258254

259-
if ($content) {
260-
this._$cancelButton.appendTo($content);
255+
if (!$content) {
256+
return;
261257
}
262258

259+
const that = this;
260+
261+
this._$cancelButton = $('<div>')
262+
.addClass(ACTION_SHEET_CANCEL_BUTTON_CLASS)
263+
.appendTo($content);
264+
263265
this._createComponent(this._$cancelButton, Button, {
264266
disabled: false,
265267
stylingMode: ACTION_SHEET_BUTTON_DEFAULT_STYLING_MODE,

packages/devextreme/js/__internal/ui/m_dialog.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@ export const custom = function (options) {
9797
dragAndResizeArea: window,
9898
onContentReady(args) {
9999
args.component.$content()
100-
.addClass(DX_DIALOG_CONTENT_CLASSNAME)
100+
?.addClass(DX_DIALOG_CONTENT_CLASSNAME)
101101
.append($message);
102102

103103
if (messageId) {
104-
args.component.$overlayContent().attr('aria-labelledby', messageId);
104+
args.component.$overlayContent()?.attr('aria-labelledby', messageId);
105105
}
106106
},
107107
onShowing(e) {

packages/devextreme/js/__internal/ui/m_drop_down_box.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -226,19 +226,20 @@ class DropDownBox<
226226
if (!(contentTemplate && this.option('contentTemplate'))) {
227227
return;
228228
}
229-
// @ts-expect-error ts-error
230-
const $popupContent = this._popup.$content();
231-
const templateData = {
232-
value: this._fieldRenderData(),
233-
component: this,
234-
};
235229

236-
$popupContent?.empty();
230+
const $popupContent = this._popup?.$content();
237231

238232
if (!$popupContent) {
239233
return;
240234
}
241235

236+
const templateData = {
237+
value: this._fieldRenderData(),
238+
component: this,
239+
};
240+
241+
$popupContent.empty();
242+
242243
contentTemplate.render({
243244
container: getPublicElement($popupContent),
244245
model: templateData,

packages/devextreme/js/__internal/ui/m_load_panel.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,16 +134,17 @@ class LoadPanel extends Overlay<LoadPanelProperties> {
134134
_renderContentImpl(): void {
135135
super._renderContentImpl();
136136

137-
this.$content()?.addClass(LOADPANEL_CONTENT_CLASS);
138-
139-
this._$loadPanelContentWrapper = $('<div>').addClass(LOADPANEL_CONTENT_WRAPPER_CLASS);
140-
141137
const $content = this.$content();
142138

143-
if ($content) {
144-
this._$loadPanelContentWrapper.appendTo($content);
139+
if (!$content) {
140+
return;
145141
}
146142

143+
this.$content()?.addClass(LOADPANEL_CONTENT_CLASS);
144+
145+
this._$loadPanelContentWrapper = $('<div>').addClass(LOADPANEL_CONTENT_WRAPPER_CLASS);
146+
this._$loadPanelContentWrapper.appendTo($content);
147+
147148
this._togglePaneVisible();
148149

149150
this._cleanPreviousContent();

packages/devextreme/js/__internal/ui/speed_dial_action/m_speed_dial_item.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class SpeedDialItem extends Overlay<SpeedDialItemProperties> {
8383

8484
_moveToContainer(): void {
8585
if (this._$wrapper) {
86-
this._$wrapper?.appendTo(this.$element());
86+
this._$wrapper.appendTo(this.$element());
8787
this._$content?.appendTo(this._$wrapper);
8888
}
8989
}

packages/devextreme/js/__internal/ui/text_box/m_text_editor.clear.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default class ClearButton extends TextEditorButton {
3838
return !!editor?._isClearButtonVisible();
3939
}
4040

41-
_attachEvents(instance, $button: dxElementWrapper): void {
41+
_attachEvents(instance: dxElementWrapper, $button: dxElementWrapper): void {
4242
const editorName = this.editor?.NAME ?? '';
4343

4444
eventsEngine.on(

packages/devextreme/js/__internal/ui/toast/m_toast.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ TProperties extends ToastProperties = ToastProperties,
189189
_render(): void {
190190
super._render();
191191

192-
this.$element().addClass(TOAST_CLASS);
192+
this.$element()?.addClass(TOAST_CLASS);
193193
this.$wrapper()?.addClass(TOAST_WRAPPER_CLASS);
194194

195195
const { type } = this.option();

0 commit comments

Comments
 (0)