Skip to content
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

Open
wants to merge 3 commits into
base: 25_1
Choose a base branch
from

Conversation

nikkithelegendarypokemonster
Copy link
Contributor

No description provided.

@@ -1592,6 +1609,10 @@ const TagBox = (SelectBox as any).inherit({
this.$element().toggleClass(TAGBOX_SINGLE_LINE_CLASS, !value);
this._renderSingleLineScroll();
break;
case 'dataSource':
Copy link
Contributor

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)

Copy link
Contributor Author

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants