Skip to content

Commit 34372d6

Browse files
authored
Toolbar Menu: ignore preventScrollEvent deprecation (T1306077) (#31042)
1 parent a418238 commit 34372d6

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

packages/devextreme/js/__internal/ui/toolbar/internal/toolbar.menu.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ export default class DropDownMenu extends Widget<DropDownMenuProperties> {
244244
},
245245
deferRendering: false,
246246
preventScrollEvents: false,
247+
_ignorePreventScrollEventsDeprecation: true,
247248
contentTemplate: (contentElement) => this._renderList(contentElement),
248249
_ignoreFunctionValueDeprecation: true,
249250
// @ts-expect-error

packages/devextreme/testing/tests/DevExpress.ui.widgets/toolbar.menu.tests.js

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { DataSource } from 'common/data/data_source/data_source';
1515
import { isRenderer } from 'core/utils/type';
1616
import themes from 'ui/themes';
1717
import { shouldSkipOnMobile } from '../../helpers/device.js';
18+
import errors from 'core/errors';
1819

1920
import 'generic_light.css!';
2021

@@ -192,6 +193,15 @@ QUnit.module('render with popup', moduleConfig, () => {
192193

193194
assert.ok(overlayTop >= buttonBottom);
194195
});
196+
197+
QUnit.test('should not throw a warning about the preventScroll event option is deprecated on popup opening (T1306077)', function(assert) {
198+
sinon.spy(errors, 'log');
199+
200+
this.overflowMenu.click();
201+
202+
assert.strictEqual(errors.log.callCount, 0, 'warning was not called');
203+
errors.log.restore();
204+
});
195205
});
196206

197207

@@ -271,7 +281,7 @@ QUnit.module('render', moduleConfig, () => {
271281
assert.ok(this.overflowMenu.popup().option('visible'), 'popup is visible');
272282
});
273283

274-
QUnit.test('popup should be placed into container specified in the \'container\' option', function(assert) {
284+
QUnit.test('popup should be placed into container specified in the container option', function(assert) {
275285
const $container = $('#dropDownMenu');
276286
this.instance.option({
277287
container: $container,
@@ -281,7 +291,7 @@ QUnit.module('render', moduleConfig, () => {
281291
assert.strictEqual(this.overflowMenu.$popupContent().closest($container).length, 1, 'Popover content located into desired container');
282292
});
283293

284-
QUnit.test('popup should be placed into new container after changing the \'container\' option', function(assert) {
294+
QUnit.test('popup should be placed into new container after changing the container option', function(assert) {
285295
const $container = $('#dropDownMenu');
286296

287297
this.instance.option('opened', true);
@@ -413,7 +423,7 @@ QUnit.module('integration', moduleConfig, () => {
413423
assert.strictEqual(this.overflowMenu.list()._dataSource.paginate(), false, 'paginate is false');
414424
});
415425

416-
QUnit.test('the \'onItemRendered\' option should be proxied to the list', function(assert) {
426+
QUnit.test('the onItemRendered option should be proxied to the list', function(assert) {
417427
const onItemRenderedHandler = sinon.stub();
418428

419429
this.instance.option({
@@ -749,7 +759,7 @@ QUnit.module('widget sizing render', moduleConfig, () => {
749759
assert.equal(itemClicked, 2, 'item was clicked twice');
750760
});
751761

752-
QUnit.test('No exceptions on \'tab\' key pressing when popup is not opened', function(assert) {
762+
QUnit.test('No exceptions on tab key pressing when popup is not opened', function(assert) {
753763
assert.expect(0);
754764

755765
this.instance.option({ focusStateEnabled: true });
@@ -761,12 +771,12 @@ QUnit.module('widget sizing render', moduleConfig, () => {
761771
});
762772
});
763773

764-
QUnit.module('\'opened\' option', moduleConfig, () => {
774+
QUnit.module('opened option', moduleConfig, () => {
765775
QUnit.test('Default option value', function(assert) {
766-
assert.strictEqual(this.instance.option('opened'), false, 'Option\'s default value is correct');
776+
assert.strictEqual(this.instance.option('opened'), false, 'Option default value is correct');
767777
});
768778

769-
QUnit.test('Change menu visibility by option \'opened\' change', function(assert) {
779+
QUnit.test('Change menu visibility by option opened change', function(assert) {
770780
this.instance.option('opened', true);
771781
assert.ok($(document.body).find('.dx-overlay-wrapper').length, 'Correctly opened by option change');
772782

0 commit comments

Comments
 (0)