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

Custom color does not reset color gallery selection state #918

Closed
nativenolde opened this issue Apr 14, 2021 · 2 comments
Closed

Custom color does not reset color gallery selection state #918

nativenolde opened this issue Apr 14, 2021 · 2 comments
Assignees
Labels
Milestone

Comments

@nativenolde
Copy link

nativenolde commented Apr 14, 2021

Hi @batzen,

we noticed that if the selected color is set (using code) to a custom one, that is not part of the gallery items, the selection state gets not reset. as you can see below, the selection state will reset only if there is a color match:

foreach (var listBox in this.listBoxes)
{
if (isSetted == false
&& listBox.Visibility == Visibility.Visible)
{
if (listBox.Items.Contains(color.Value))
{
listBox.SelectedItem = color.Value;
isSetted = true;
}
}
else
{
listBox.SelectedItem = null;
}
}

in our use case, we have a lot of fancy rich text content with some custom colorings, that are not introduced by the color gallery, but from external content creators using their own tooling. so let's assume a user writes some text and changes the fore color to red and moves to a fragment that has a custom fore color... then the red color gallery list-box-item is still selected, even if we set the selected color of the color gallery to the custom one.

i hope that this is an issue and not the intended behaviour, so that it can be fixed.

Sincerely yours

@nativenolde
Copy link
Author

My workaround is to set the selected color first to null, which will reset the selection state, and then the actual (custom) color.

@batzen batzen self-assigned this Apr 24, 2021
@batzen
Copy link
Member

batzen commented Apr 24, 2021

Will have a look and fix the issue.

@batzen batzen added this to the 9.0 milestone Apr 24, 2021
@batzen batzen closed this as completed in 8a8cd96 Apr 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants