-
Notifications
You must be signed in to change notification settings - Fork 664
Widgets: Remove code related width, height option as function (FilterBuilder, DateBox, DropDownEditor, DropDownButton, Lookup, Menu, Toolbar.Menu) #33177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 26_1
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -866,9 +866,7 @@ class DropDownEditor< | |
| }), | ||
| // @ts-expect-error ts-error | ||
| showTitle: this.option('dropDownOptions.showTitle'), | ||
| _ignoreFunctionValueDeprecation: true, | ||
| // @ts-expect-error ts-error | ||
| width: (): number => getElementWidth(this.$element()), | ||
| width: getElementWidth(this.$element()), | ||
| height: 'auto', | ||
| shading: false, | ||
| hideOnParentScroll: true, | ||
|
|
@@ -925,10 +923,10 @@ class DropDownEditor< | |
| } | ||
|
|
||
| _updatePopupWidth(): void { | ||
| const popupWidth = getSizeValue(this.option('dropDownOptions.width')); | ||
| const popupWidth = getSizeValue(this.option('_cached_dropDownOptions.width')); | ||
|
|
||
| if (popupWidth === undefined) { | ||
| this._setPopupOption('width', () => getElementWidth(this.$element())); | ||
| this._setPopupOption('width', getElementWidth(this.$element())); | ||
| } | ||
|
Comment on lines
925
to
930
|
||
| } | ||
|
|
||
|
|
@@ -1168,6 +1166,7 @@ class DropDownEditor< | |
| case 'width': | ||
| case 'height': | ||
| super._optionChanged(args); | ||
| this._updatePopupWidth(); | ||
| this._popup?.repaint(); | ||
| break; | ||
| case 'opened': | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -296,6 +296,8 @@ class DropDownBox< | |||||||||||
| position: extend(this.option('popupPosition'), { | ||||||||||||
| of: this.$element(), | ||||||||||||
| }), | ||||||||||||
| // The overlay calls maxHeight every time it calculates the content dimensions, | ||||||||||||
| // this._popupPosition?.v.location, which is updated after each repositioning | ||||||||||||
|
Comment on lines
+299
to
+300
|
||||||||||||
| // The overlay calls maxHeight every time it calculates the content dimensions, | |
| // this._popupPosition?.v.location, which is updated after each repositioning | |
| // maxHeight must remain a function because the overlay reevaluates it whenever | |
| // it recalculates content dimensions, and it depends on this._popupPosition?.v.location, | |
| // which is updated after each repositioning. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -130,14 +130,10 @@ class Lookup extends DropDownList<LookupProperties> { | |
| focusStateEnabled: false, | ||
| dropDownOptions: { | ||
| showTitle: true, | ||
| // @ts-expect-error ts-error | ||
| width() { | ||
| return getSize('width'); | ||
| }, | ||
| // @ts-expect-error ts-error | ||
| height() { | ||
| return getSize('height'); | ||
| }, | ||
| // @ts-expect-error Category 3 — There is no built-in mechanism for mandatory updates | ||
| width: () => getSize('width'), | ||
| // @ts-expect-error Category 3 — There is no built-in mechanism for mandatory updates | ||
| height: () => getSize('height'), | ||
|
Comment on lines
131
to
+136
|
||
| shading: true, | ||
| hideOnOutsideClick: true, | ||
| animation: {}, | ||
|
|
@@ -218,7 +214,7 @@ class Lookup extends DropDownList<LookupProperties> { | |
| dropDownOptions: { | ||
| _ignoreFunctionValueDeprecation: true, | ||
|
|
||
| width: () => getElementWidth(this.$element()), | ||
| width: getElementWidth(this.$element()), | ||
| height: function () { return this._getPopupHeight(); }.bind(this), | ||
|
Comment on lines
214
to
218
|
||
| showTitle: false, | ||
|
|
||
|
|
@@ -819,6 +815,7 @@ class Lookup extends DropDownList<LookupProperties> { | |
| this.option('dropDownOptions.width', getWidth(this.$element())); | ||
| } | ||
|
|
||
| this._updatePopupWidth(); | ||
| this._updateListDimensions(); | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ts-expect-erroronpopup.show(...)makes the mock less type-safe and can mask real API drift. Prefer updating theAppointmentPopup.showtyping (or the mock wrapper types) so the{ onSave, title, readOnly }argument is accepted without suppression, matching howappointmentPopup.showis used in scheduler code.