Skip to content

Commit

Permalink
TabPanel: Fix updating tabs indicator position (#25957)
Browse files Browse the repository at this point in the history
  • Loading branch information
marker-dao authored Nov 6, 2023
1 parent 7f45386 commit 1d44c1a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/devextreme/js/ui/tab_panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ const TabPanel = MultiView.inherit({
_updateTabsIndicatorPosition() {
const value = this._getTabsIndicatorPosition();

this.option('_tabsIndicatorPosition', value);
this._setTabsOption('_indicatorPosition', value);
},

_optionChanged: function(args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,21 @@ QUnit.module('Tabs Indicator position', () => {

assert.notOk($tabs.hasClass(TABS_INDICATOR_POSITION_CLASS_BY_TABS_POSITION['top']));
assert.ok($tabs.hasClass(TABS_INDICATOR_POSITION_CLASS_BY_TABS_POSITION['left']));

tabPanel.option({ tabsPosition: 'bottom' });

assert.notOk($tabs.hasClass(TABS_INDICATOR_POSITION_CLASS_BY_TABS_POSITION['left']));
assert.ok($tabs.hasClass(TABS_INDICATOR_POSITION_CLASS_BY_TABS_POSITION['bottom']));

tabPanel.option({ tabsPosition: 'right' });

assert.notOk($tabs.hasClass(TABS_INDICATOR_POSITION_CLASS_BY_TABS_POSITION['bottom']));
assert.ok($tabs.hasClass(TABS_INDICATOR_POSITION_CLASS_BY_TABS_POSITION['right']));

tabPanel.option({ tabsPosition: 'top' });

assert.notOk($tabs.hasClass(TABS_INDICATOR_POSITION_CLASS_BY_TABS_POSITION['right']));
assert.ok($tabs.hasClass(TABS_INDICATOR_POSITION_CLASS_BY_TABS_POSITION['top']));
});

QUnit.test('The tabs element must have the correct indicator position class when _tabsIndicatorPosition was changed', function(assert) {
Expand Down

0 comments on commit 1d44c1a

Please sign in to comment.