Skip to content

Autocomplete, DropDownButton, DropDownBox: Refactor and improve typing#33784

Open
vorobey wants to merge 16 commits into
DevExpress:26_1from
vorobey:26_1_autocomplete_refactore_types
Open

Autocomplete, DropDownButton, DropDownBox: Refactor and improve typing#33784
vorobey wants to merge 16 commits into
DevExpress:26_1from
vorobey:26_1_autocomplete_refactore_types

Conversation

@vorobey
Copy link
Copy Markdown
Contributor

@vorobey vorobey commented Jun 2, 2026

No description provided.

@vorobey vorobey self-assigned this Jun 2, 2026
@vorobey vorobey added the 26_1 label Jun 2, 2026
@github-actions github-actions Bot added the .d.ts label Jun 2, 2026
@vorobey vorobey force-pushed the 26_1_autocomplete_refactore_types branch 4 times, most recently from 7f2364e to 4cfdc31 Compare June 4, 2026 11:41
@vorobey vorobey force-pushed the 26_1_autocomplete_refactore_types branch from d981be3 to 3fc9002 Compare June 5, 2026 08:42
@vorobey vorobey marked this pull request as ready for review June 5, 2026 09:15
@vorobey vorobey requested a review from a team as a code owner June 5, 2026 09:15
Copilot AI review requested due to automatic review settings June 5, 2026 09:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors internal implementations and public typings around DropDownButton / DropDownBox / Autocomplete and Overlay to reduce @ts-expect-error usage and better reflect runtime behavior (e.g., allowing null templates and function-valued hideOnParentScroll) across core, Angular, React, and Vue wrappers.

Changes:

  • Updated public .d.ts typings for nullable templates/selection (null) and hideOnParentScroll as boolean | (() => boolean).
  • Refactored internal DropDownButton/DropDownBox/Autocomplete code to use more explicit types and fewer @ts-expect-error suppressions.
  • Propagated updated option typings into Angular/React/Vue wrapper prop/input/output definitions.

Reviewed changes

Copilot reviewed 55 out of 58 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/devextreme/ts/dx.all.d.ts Aligns bundled typings with nullable templates/selection and functional hideOnParentScroll.
packages/devextreme/js/ui/overlay.d.ts Updates dxOverlayOptions typing for contentTemplate nullability and functional hideOnParentScroll.
packages/devextreme/js/ui/drop_down_button.d.ts Improves DropDownButton option typing (nullable selection/template) and removes some default doc tags.
packages/devextreme/js/__internal/ui/radio_group/radio_group.ts Removes a @ts-expect-error comment in option forwarding.
packages/devextreme/js/__internal/ui/m_tag_box.ts Removes several @ts-expect-error comments around value/display handling.
packages/devextreme/js/__internal/ui/m_select_box.ts Adds/adjusts explicit return types and removes @ts-expect-error comments around display getter usage.
packages/devextreme/js/__internal/ui/m_drop_down_button.ts Large refactor to tighten typing, reduce suppressions, and adjust popup/list wiring and ARIA updates.
packages/devextreme/js/__internal/ui/m_drop_down_box.ts Refactors typing around DataExpressionMixin usage and popup behaviors; replaces imports and removes suppressions.
packages/devextreme/js/__internal/ui/m_autocomplete.ts Refactors typings/events and list configuration; replaces some imports and adds explicit signatures.
packages/devextreme/js/__internal/ui/drop_down_editor/drop_down_list.ts Adds DataExpressionMixin workaround typings and removes some suppressions; adjusts display-value helper.
packages/devextreme/js/__internal/ui/drop_down_editor/drop_down_editor.ts Adjusts @ts-expect-error placement for popup options typing.
packages/devextreme/js/__internal/events/utils/index.ts Minor defensive typing change (e?.type) for wheel event detection.
packages/devextreme/js/__internal/data/data_controller/data_controller.ts Exposes DataSourceType and loosens updateDataSource parameter optionality.
packages/devextreme/js/__internal/core/widget/widget.ts Small cleanup (onKeyboardHandled?.(...)) and refines _setWidgetOption typing.
packages/devextreme-vue/src/tree-list.ts Updates wrapper prop typing for functional hideOnParentScroll.
packages/devextreme-vue/src/toast.ts Updates wrapper prop typing for functional hideOnParentScroll.
packages/devextreme-vue/src/tag-box.ts Updates wrapper prop typing for functional hideOnParentScroll.
packages/devextreme-vue/src/select-box.ts Updates wrapper prop typing for functional hideOnParentScroll.
packages/devextreme-vue/src/popup.ts Updates wrapper prop typing for functional hideOnParentScroll.
packages/devextreme-vue/src/load-panel.ts Updates wrapper prop typing for functional hideOnParentScroll.
packages/devextreme-vue/src/drop-down-button.ts Updates selectedItemKey to allow null and updates hideOnParentScroll typing.
packages/devextreme-vue/src/drop-down-box.ts Updates wrapper prop typing for functional hideOnParentScroll.
packages/devextreme-vue/src/date-range-box.ts Updates wrapper prop typing for functional hideOnParentScroll.
packages/devextreme-vue/src/date-box.ts Updates wrapper prop typing for functional hideOnParentScroll.
packages/devextreme-vue/src/data-grid.ts Updates wrapper prop typing for functional hideOnParentScroll.
packages/devextreme-vue/src/color-box.ts Updates wrapper prop typing for functional hideOnParentScroll.
packages/devextreme-vue/src/card-view.ts Updates wrapper prop typing for functional hideOnParentScroll.
packages/devextreme-vue/src/autocomplete.ts Updates wrapper prop typing for functional hideOnParentScroll.
packages/devextreme-react/src/tree-list.ts Updates wrapper prop typing for nullable contentTemplate and functional hideOnParentScroll.
packages/devextreme-react/src/tag-box.ts Updates wrapper prop typing for nullable contentTemplate and functional hideOnParentScroll.
packages/devextreme-react/src/select-box.ts Updates wrapper prop typing for nullable contentTemplate and functional hideOnParentScroll.
packages/devextreme-react/src/lookup.ts Updates wrapper prop typing for nullable contentTemplate.
packages/devextreme-react/src/drop-down-button.ts Updates wrapper prop typing for nullable contentTemplate and functional hideOnParentScroll.
packages/devextreme-react/src/drop-down-box.ts Updates wrapper prop typing for nullable contentTemplate and functional hideOnParentScroll.
packages/devextreme-react/src/date-range-box.ts Updates wrapper prop typing for nullable contentTemplate and functional hideOnParentScroll.
packages/devextreme-react/src/date-box.ts Updates wrapper prop typing for nullable contentTemplate and functional hideOnParentScroll.
packages/devextreme-react/src/data-grid.ts Updates wrapper prop typing for nullable contentTemplate and functional hideOnParentScroll.
packages/devextreme-react/src/color-box.ts Updates wrapper prop typing for nullable contentTemplate and functional hideOnParentScroll.
packages/devextreme-react/src/card-view.ts Updates wrapper prop typing for functional hideOnParentScroll.
packages/devextreme-react/src/autocomplete.ts Updates wrapper prop typing for nullable contentTemplate and functional hideOnParentScroll.
packages/devextreme-angular/src/ui/tree-list/nested/popup.ts Updates Angular input typing for functional hideOnParentScroll.
packages/devextreme-angular/src/ui/tree-list/nested/filter-builder-popup.ts Updates Angular input typing for functional hideOnParentScroll.
packages/devextreme-angular/src/ui/toast/index.ts Updates Angular input/output typing for functional hideOnParentScroll.
packages/devextreme-angular/src/ui/tag-box/nested/drop-down-options.ts Updates Angular input typing for functional hideOnParentScroll.
packages/devextreme-angular/src/ui/select-box/nested/drop-down-options.ts Updates Angular input typing for functional hideOnParentScroll.
packages/devextreme-angular/src/ui/popup/component.ts Updates Angular input/output typing for functional hideOnParentScroll.
packages/devextreme-angular/src/ui/nested/base/popup-options.ts Updates base nested popup options typing (notably contentTemplate / hideOnParentScroll).
packages/devextreme-angular/src/ui/load-panel/index.ts Updates Angular input/output typing for functional hideOnParentScroll.
packages/devextreme-angular/src/ui/drop-down-button/nested/drop-down-options.ts Updates Angular nested dropdown option typing for functional hideOnParentScroll.
packages/devextreme-angular/src/ui/drop-down-button/index.ts Updates Angular input/output typing for nullable selection and selectedItemKey nullability.
packages/devextreme-angular/src/ui/drop-down-box/nested/drop-down-options.ts Updates Angular nested dropdown option typing for functional hideOnParentScroll.
packages/devextreme-angular/src/ui/date-range-box/nested/drop-down-options.ts Updates Angular nested dropdown option typing for functional hideOnParentScroll.
packages/devextreme-angular/src/ui/date-box/nested/drop-down-options.ts Updates Angular nested dropdown option typing for functional hideOnParentScroll.
packages/devextreme-angular/src/ui/data-grid/nested/popup.ts Updates Angular nested popup option typing for functional hideOnParentScroll.
packages/devextreme-angular/src/ui/data-grid/nested/filter-builder-popup.ts Updates Angular nested popup option typing for functional hideOnParentScroll.
packages/devextreme-angular/src/ui/color-box/nested/drop-down-options.ts Updates Angular nested dropdown option typing for functional hideOnParentScroll.
packages/devextreme-angular/src/ui/card-view/nested/load-panel.ts Updates Angular nested load panel option typing for functional hideOnParentScroll.
packages/devextreme-angular/src/ui/autocomplete/nested/drop-down-options.ts Updates Angular nested dropdown option typing for functional hideOnParentScroll.

Comment thread packages/devextreme/js/__internal/ui/m_autocomplete.ts
Comment thread packages/devextreme/js/__internal/ui/drop_down_editor/drop_down_list.ts Outdated
Comment thread packages/devextreme-angular/src/ui/nested/base/popup-options.ts Outdated
Comment thread packages/devextreme/js/__internal/core/widget/widget.ts Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Andrey Vorobev <dobriy.kaa@gmail.com>
Copilot AI review requested due to automatic review settings June 5, 2026 09:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 55 out of 58 changed files in this pull request and generated 4 comments.

Comment thread packages/devextreme-angular/src/ui/nested/base/popup-options.ts Outdated
Comment thread packages/devextreme/js/__internal/ui/m_autocomplete.ts Outdated
Comment thread packages/devextreme/js/__internal/ui/m_drop_down_button.ts Outdated
Comment thread packages/devextreme/js/__internal/ui/m_drop_down_button.ts Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Andrey Vorobev <dobriy.kaa@gmail.com>
Copilot AI review requested due to automatic review settings June 5, 2026 10:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 55 out of 58 changed files in this pull request and generated 2 comments.

Comment thread packages/devextreme-angular/src/ui/nested/base/popup-options.ts Outdated
Comment thread packages/devextreme/js/__internal/ui/m_autocomplete.ts Outdated
@github-actions github-actions Bot removed the .d.ts label Jun 5, 2026
Copilot AI review requested due to automatic review settings June 5, 2026 13:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

Comment thread packages/devextreme/js/__internal/ui/m_autocomplete.ts Outdated
Comment thread packages/devextreme/js/__internal/ui/m_autocomplete.ts Outdated
Comment thread packages/devextreme/js/__internal/ui/m_drop_down_button.ts Outdated
downArrow(e): boolean {
// @ts-expect-error ts-error
if (parent.downArrow.apply(this, arguments) && !isCommandKeyPressed(e)) {
downArrow: (e): boolean => {
Copy link
Copy Markdown
Contributor

@r-farkhutdinov r-farkhutdinov Jun 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason to convert the method to an arrow function? The original implementation relied on dynamic this binding and forwarded all arguments via apply(this, arguments). The new version changes both behaviors (arguments -> e which is correct, method -> arrow function), so it may not be fully equivalent.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

main reason was to fix using "arguments", i removed arrows, but have kept call instead of apply, because we only use e here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants