Skip to content

Commit 0dfb828

Browse files
Merge branch '26_1' into 26_1_global_format
2 parents af3d2b4 + cc44e6c commit 0dfb828

12 files changed

Lines changed: 269 additions & 59 deletions

File tree

e2e/testcafe-devextreme/tests/editors/dateBox/dateBox.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import url from '../../../helpers/getPageUrl';
55
import asyncForEach from '../../../helpers/asyncForEach';
66
import { createWidget } from '../../../helpers/createWidget';
77
import { isMaterialBased, testScreenshot } from '../../../helpers/themeUtils';
8+
import { Themes } from '../../../helpers/themes';
89

910
fixture.disablePageReloads`DateBox`
1011
.page(url(__dirname, '../../container.html'));
@@ -71,7 +72,7 @@ test('DateBox with datetime and root element as container (T1193495)', async (t)
7172
},
7273
}, '#container'));
7374

74-
test('DateBox with datetime and opened AM/PM select (T1312677)', async (t) => {
75+
test.meta({ themes: [Themes.materialBlue, Themes.genericLight, Themes.fluentBlue] })('DateBox with datetime and opened AM/PM select (T1312677, T1327616)', async (t) => {
7576
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
7677

7778
const timeViewSelect = Selector(`#container .${TIME_VIEW_FIELD_CLASS} .${SELECT_BOX_CONTAINER_CLASS}`);
@@ -94,6 +95,7 @@ test('DateBox with datetime and opened AM/PM select (T1312677)', async (t) => {
9495
type: 'datetime',
9596
pickerType: 'calendar',
9697
opened: true,
98+
applyValueMode: 'instantly',
9799
dropDownOptions: {
98100
container: '#container',
99101
},
-1.52 KB
Loading
38.4 KB
Loading
37.7 KB
Loading

packages/devextreme-scss/scss/widgets/base/_dateBox.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@
4040
}
4141

4242
.dx-datebox-wrapper {
43+
> .dx-overlay-content:first-child {
44+
overflow: visible;
45+
}
46+
4347
.dx-popup-content {
4448
padding-top: 20px;
4549
padding-bottom: 20px;

packages/devextreme-scss/scss/widgets/material/dateBox/_index.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@
3434
width: auto;
3535
}
3636
}
37-
38-
> .dx-overlay-content:first-child {
39-
overflow: visible;
40-
}
4137
}
4238

4339
.dx-datebox-datetime-time-side {

packages/devextreme/js/__internal/ui/drop_down_editor/m_drop_down_list.ts

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ const SEARCH_MODES = ['startswith', 'contains', 'endwith', 'notcontains'];
4848
const useCompositionEvents = devices.real().platform !== 'android';
4949

5050
interface DropDownListProperties extends Omit<dxDropDownListOptions<DropDownList>,
51-
'onOpened' | 'onClosed'
52-
| 'onChange' | 'onCopy' | 'onCut' | 'onEnterKey' | 'onFocusIn' | 'onFocusOut' | 'onInput' | 'onKeyDown' | 'onKeyUp' | 'onPaste'
53-
| 'onValueChanged' | 'validationMessagePosition' | 'onContentReady' | 'onDisposing' | 'onOptionChanged' | 'onInitialized'> {
51+
'onOpened' | 'onClosed'
52+
| 'onChange' | 'onCopy' | 'onCut' | 'onEnterKey' | 'onFocusIn' | 'onFocusOut' | 'onInput' | 'onKeyDown' | 'onKeyUp' | 'onPaste'
53+
| 'onValueChanged' | 'validationMessagePosition' | 'onContentReady' | 'onDisposing' | 'onOptionChanged' | 'onInitialized'> {
5454
encodeNoDataText?: boolean;
5555
}
5656

@@ -624,7 +624,7 @@ class DropDownList<
624624
dataSource: this._getDataSource(),
625625
_dataController: this._dataController,
626626
hoverStateEnabled: this._isDesktopDevice() ? hoverStateEnabled : false,
627-
focusStateEnabled: this._isDesktopDevice() ? focusStateEnabled : false,
627+
focusStateEnabled,
628628
_onItemsRendered: (): void => {
629629
// @ts-expect-error ts-error
630630
this._popup.repaint();
@@ -699,7 +699,7 @@ class DropDownList<
699699
}
700700

701701
// eslint-disable-next-line @typescript-eslint/no-unused-vars
702-
_listItemClickHandler(e?): void {}
702+
_listItemClickHandler(e?): void { }
703703

704704
_setListDataSource(): void {
705705
if (!this._list) {
@@ -733,10 +733,10 @@ class DropDownList<
733733
_canKeepDataSource(): boolean {
734734
const isMinSearchLengthExceeded = this._isMinSearchLengthExceeded();
735735
return this._dataController.isLoaded()
736-
&& this.option('showDataBeforeSearch')
737-
&& this.option('minSearchLength')
738-
&& !isMinSearchLengthExceeded
739-
&& !this._isLastMinSearchLengthExceeded;
736+
&& this.option('showDataBeforeSearch')
737+
&& this.option('minSearchLength')
738+
&& !isMinSearchLengthExceeded
739+
&& !this._isLastMinSearchLengthExceeded;
740740
}
741741

742742
_searchValue() {
@@ -992,10 +992,13 @@ class DropDownList<
992992
this._dataExpressionOptionChanged(args);
993993
switch (args.name) {
994994
case 'hoverStateEnabled':
995-
case 'focusStateEnabled':
996995
this._isDesktopDevice() && this._setListOption(args.name, args.value);
997996
super._optionChanged(args);
998997
break;
998+
case 'focusStateEnabled':
999+
this._setListOption(args.name, args.value);
1000+
super._optionChanged(args);
1001+
break;
9991002
case 'items':
10001003
if (!this.option('dataSource')) {
10011004
this._processDataSourceChanging();

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

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ class Lookup extends DropDownList<LookupProperties> {
294294
});
295295
}
296296

297-
_fireContentReadyAction() {}
297+
_fireContentReadyAction() { }
298298

299299
_popupWrapperClass() {
300300
return '';
@@ -371,7 +371,7 @@ class Lookup extends DropDownList<LookupProperties> {
371371
}
372372
}
373373

374-
_renderButtonContainers(): void {}
374+
_renderButtonContainers(): void { }
375375

376376
_renderFieldTemplate(template) {
377377
this._$field.empty();
@@ -671,7 +671,7 @@ class Lookup extends DropDownList<LookupProperties> {
671671
}
672672
}
673673

674-
_preventFocusOnPopup(): void {}
674+
_preventFocusOnPopup(): void { }
675675

676676
_shouldLoopFocusInsidePopup(): boolean {
677677
const {
@@ -765,32 +765,43 @@ class Lookup extends DropDownList<LookupProperties> {
765765
}
766766

767767
_popupToolbarItemsConfig() {
768+
const { focusStateEnabled, applyButtonText: text } = this.option();
769+
768770
return [
769771
{
770772
shortcut: 'done',
771773
options: {
774+
text,
775+
focusStateEnabled,
772776
onClick: this._applyButtonHandler.bind(this),
773-
text: this.option('applyButtonText'),
774777
},
775778
},
776779
];
777780
}
778781

779782
_getCancelButtonConfig() {
780-
return this.option('showCancelButton') ? {
783+
const { focusStateEnabled, cancelButtonText: text, showCancelButton } = this.option();
784+
785+
return showCancelButton ? {
781786
shortcut: 'cancel',
782-
onClick: this._cancelButtonHandler.bind(this),
783787
options: {
784-
text: this.option('cancelButtonText'),
788+
text,
789+
focusStateEnabled,
785790
},
791+
onClick: this._cancelButtonHandler.bind(this),
786792
} : null;
787793
}
788794

789795
_getClearButtonConfig() {
790-
return this.option('showClearButton') ? {
796+
const { showClearButton, clearButtonText: text, focusStateEnabled } = this.option();
797+
798+
return showClearButton ? {
791799
shortcut: 'clear',
800+
options: {
801+
text,
802+
focusStateEnabled,
803+
},
792804
onClick: this._resetValue.bind(this),
793-
options: { text: this.option('clearButtonText') },
794805
} : null;
795806
}
796807

@@ -832,7 +843,7 @@ class Lookup extends DropDownList<LookupProperties> {
832843
this._renderSearch();
833844
}
834845

835-
_renderValueChangeEvent(): void {}
846+
_renderValueChangeEvent(): void { }
836847

837848
_renderSearch(): void {
838849
const isSearchEnabled = this.option('searchEnabled');
@@ -861,8 +872,10 @@ class Lookup extends DropDownList<LookupProperties> {
861872
onDisposing: () => isKeyboardListeningEnabled = false,
862873
// eslint-disable-next-line no-return-assign
863874
onFocusIn: () => isKeyboardListeningEnabled = true,
864-
// eslint-disable-next-line no-return-assign
865-
onFocusOut: () => isKeyboardListeningEnabled = false,
875+
onFocusOut: () => {
876+
isKeyboardListeningEnabled = false;
877+
this._list?.option('focusedElement', null);
878+
},
866879
// @ts-expect-error ts-error
867880
onKeyboardHandled: (opts) => isKeyboardListeningEnabled && this._list._keyboardHandler(opts),
868881
onValueChanged: (e) => this._searchHandler(e),
@@ -954,11 +967,11 @@ class Lookup extends DropDownList<LookupProperties> {
954967
this._searchBox?.option('placeholder', placeholder);
955968
}
956969

957-
_setAriaTargetForList(): void {}
970+
_setAriaTargetForList(): void { }
958971

959972
_listConfig() {
960973
return extend(super._listConfig(), {
961-
tabIndex: 0,
974+
tabIndex: this.option('searchEnabled') ? -1 : 0,
962975
grouped: this.option('grouped'),
963976
groupTemplate: this._getTemplateByOption('groupTemplate'),
964977
pullRefreshEnabled: this.option('pullRefreshEnabled'),
@@ -1093,6 +1106,7 @@ class Lookup extends DropDownList<LookupProperties> {
10931106
this._removeSearch();
10941107
this._renderSearch();
10951108
}
1109+
this._setListOption('tabIndex', value ? -1 : 0);
10961110
break;
10971111
case 'searchPlaceholder':
10981112
this._setSearchPlaceholder();
@@ -1109,6 +1123,11 @@ class Lookup extends DropDownList<LookupProperties> {
11091123
case 'placeholder':
11101124
this._invalidate();
11111125
break;
1126+
case 'focusStateEnabled':
1127+
this._setPopupOption('toolbarItems', this._getPopupToolbarItems());
1128+
// @ts-expect-error ts-error
1129+
super._optionChanged(...arguments);
1130+
break;
11121131
case 'clearButtonText':
11131132
case 'showClearButton':
11141133
case 'showCancelButton':

packages/devextreme/js/ui/scheduler.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,9 @@ export type OptionChangedEvent = EventInfo<dxScheduler> & ChangedOptionInfo;
375375
* @inherits EventInfo
376376
*/
377377
export type SelectionEndEvent = EventInfo<dxScheduler> & {
378+
/**
379+
* @docid
380+
*/
378381
readonly selectedCellData: Array<any>;
379382
};
380383

packages/devextreme/testing/tests/DevExpress.ui.widgets.editors/dropDownList.tests.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ QUnit.module('focus policy', {
101101
}
102102
});
103103

104-
QUnit.test('hover and focus states for list should be initially disabled on mobile devices only', function(assert) {
104+
QUnit.test('hover state for list should be initially disabled on mobile devices, focus state should follow parent', function(assert) {
105105
this.instance.option('opened', true);
106106

107107
const list = $(`.${LIST_CLASS}`).dxList('instance');
@@ -111,11 +111,11 @@ QUnit.module('focus policy', {
111111
assert.ok(list.option('focusStateEnabled'), 'focus state should be enabled on desktop');
112112
} else {
113113
assert.notOk(list.option('hoverStateEnabled'), 'hover state should be disabled on mobiles');
114-
assert.notOk(list.option('focusStateEnabled'), 'focus state should be disabled on mobiles');
114+
assert.ok(list.option('focusStateEnabled'), 'focus state should follow parent value on mobiles');
115115
}
116116
});
117117

118-
QUnit.test('changing hover and focus states for list should be enabled on desktop only', function(assert) {
118+
QUnit.test('changing hover state for list should be enabled on desktop only, focus state should be enabled on both desktop and mobile', function(assert) {
119119
this.instance.option('opened', true);
120120

121121
const list = $(`.${LIST_CLASS}`).dxList('instance');
@@ -126,10 +126,13 @@ QUnit.module('focus policy', {
126126
assert.notOk(list.option('hoverStateEnabled'), 'hover state should be changed to disabled on desktop');
127127
assert.notOk(list.option('focusStateEnabled'), 'focus state should be changed to disabled on desktop');
128128
} else {
129+
assert.notOk(list.option('hoverStateEnabled'), 'hover state should not be changed on mobiles');
130+
assert.notOk(list.option('focusStateEnabled'), 'focus state should be changed on mobiles');
131+
129132
this.instance.option({ hoverStateEnabled: true, focusStateEnabled: true });
130133

131134
assert.notOk(list.option('hoverStateEnabled'), 'hover state should not be changed on mobiles');
132-
assert.notOk(list.option('focusStateEnabled'), 'focus state should not be changed on mobiles');
135+
assert.ok(list.option('focusStateEnabled'), 'focus state should be changed on mobiles');
133136
}
134137
});
135138

0 commit comments

Comments
 (0)