Skip to content

Commit c9df0e2

Browse files
Scheduler New Form — Address review: use element(), simplify updateAnimationOffset
1 parent 7ae06d4 commit c9df0e2

2 files changed

Lines changed: 6 additions & 9 deletions

File tree

packages/devextreme/js/__internal/scheduler/appointment_popup/appointment_popup.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1602,7 +1602,7 @@ describe('Appointment Form', () => {
16021602

16031603
POM.popup.selectRepeatValue('weekly');
16041604

1605-
const formElement = POM.popup.dxForm.$element()[0];
1605+
const formElement = POM.popup.dxForm.element();
16061606
const animationTop = formElement.style.getPropertyValue('--dx-scheduler-animation-top');
16071607
expect(animationTop).toBe('50px');
16081608
});

packages/devextreme/js/__internal/scheduler/appointment_popup/m_form.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,15 +1071,12 @@ export class AppointmentForm {
10711071
return;
10721072
}
10731073

1074-
const formElement = this.dxForm.$element()[0];
1074+
const formElement = this.dxForm.element();
10751075
const mainGroupElement = this._$mainGroup[0];
1076-
1077-
if (formElement && mainGroupElement) {
1078-
const formRect = formElement.getBoundingClientRect();
1079-
const groupRect = mainGroupElement.getBoundingClientRect();
1080-
const topOffset = groupRect.top - formRect.top;
1081-
formElement.style.setProperty('--dx-scheduler-animation-top', `${topOffset}px`);
1082-
}
1076+
const formRect = formElement.getBoundingClientRect();
1077+
const groupRect = mainGroupElement.getBoundingClientRect();
1078+
const topOffset = groupRect.top - formRect.top;
1079+
formElement.style.setProperty('--dx-scheduler-animation-top', `${topOffset}px`);
10831080
}
10841081

10851082
private focusFirstFocusableInGroup($group: dxElementWrapper): void {

0 commit comments

Comments
 (0)