-
Notifications
You must be signed in to change notification settings - Fork 609
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TagBox: re-render tags when dataSource is updated (T1253312) #28691
base: 25_1
Are you sure you want to change the base?
TagBox: re-render tags when dataSource is updated (T1253312) #28691
Conversation
@@ -1592,6 +1609,10 @@ const TagBox = (SelectBox as any).inherit({ | |||
this.$element().toggleClass(TAGBOX_SINGLE_LINE_CLASS, !value); | |||
this._renderSingleLineScroll(); | |||
break; | |||
case 'dataSource': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here we lost default behavior from parent class which set new dataSource to editor and list, it also forced tags rerender
So, there is no need to rewrite the whole function, just add some logic to _setListDataSource
to support _selectedItems
, and, perhaps, value
update (later it will be set to list options in _refreshSelected
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hello Anna i replicated your issue yes dataSource is not updating in _list and editor can you try my solution here using callBase(args) instead since in my opinion i don't want to use setListDataSource since we are changing selectedItems and value options not on _list but on tag box level instead so i like to use a separate method for it.... can you check my solution as well... thank you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should keep editor and list options synchronized, in _refreshSelected,
se;ectedItems
list option is set to be equal to this,_selectedItems
, so we should update the last one as well
i suggested to combine syncLogic with _setListDataSource
, to avoid setting value twice
packages/devextreme/testing/tests/DevExpress.ui.widgets.editors/tagBox.tests.js
Outdated
Show resolved
Hide resolved
packages/devextreme/testing/tests/DevExpress.ui.widgets.editors/tagBox.tests.js
Outdated
Show resolved
Hide resolved
packages/devextreme/testing/tests/DevExpress.ui.widgets.editors/tagBox.tests.js
Outdated
Show resolved
Hide resolved
packages/devextreme/testing/tests/DevExpress.ui.widgets.editors/tagBox.tests.js
Show resolved
Hide resolved
packages/devextreme/testing/tests/DevExpress.ui.widgets.editors/tagBox.tests.js
Show resolved
Hide resolved
…25_1-tagbox-bug-datasource-changing
No description provided.