DropDownEditor: Improve types#33760
Open
r-farkhutdinov wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tightens TypeScript typings and reduces ad-hoc option('...') string access patterns across internal DropDownEditor-related code, aiming to make option handling and template/popup interactions more type-safe.
Changes:
- Refactors DropDownEditor internals to use typed option destructuring, adds/clarifies option and template-related types, and improves event handler typings.
- Introduces stricter helper types for dropdown size/width normalization (
getElementWidth,getSizeValue). - Updates related consumers (Lookup and DateBox list strategy) to use the adjusted option/value handling patterns.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/devextreme/js/__internal/ui/m_lookup.ts | Adjusts option-change args passed to popup/inner widget when dropdown width/height is 'auto'. |
| packages/devextreme/js/__internal/ui/drop_down_editor/m_utils.ts | Adds SizeValue and typed helpers for element width and size normalization. |
| packages/devextreme/js/__internal/ui/drop_down_editor/m_drop_down_editor.ts | Broad typing improvements: option destructuring, template/popup types, safer casts, and updated handlers. |
| packages/devextreme/js/__internal/ui/date_box/m_date_box.strategy.list.ts | Switches popup height retrieval to destructured dropDownOptions with getSizeValue. |
Comment on lines
+1051
to
1054
| _setPopupOption(...args: [string, unknown?]): void { | ||
| // @ts-expect-error Should be fixed on Widget level | ||
| this._setWidgetOption('_popup', args); | ||
| } |
Comment on lines
+683
to
+687
| // @ts-expect-error NAME property is missing | ||
| eventsEngine.on(this._inputWrapper(), addNamespace('focusout', this.NAME), (event: FocusEvent) => { | ||
| const newTarget = event.relatedTarget; | ||
| if (newTarget && this.option('opened')) { | ||
| const { opened } = this.option(); | ||
| if (newTarget && opened) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.