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

SelectEdit : Handling for No-Match #252

Closed
brettwinters opened this issue Sep 12, 2019 · 4 comments
Closed

SelectEdit : Handling for No-Match #252

brettwinters opened this issue Sep 12, 2019 · 4 comments
Labels
Type: Feature ⚙ Request or idea for a new feature.
Projects
Milestone

Comments

@brettwinters
Copy link

brettwinters commented Sep 12, 2019

Hi @stsrki

Currently if the SelectedValue does not match any of the SelectItems, the SelectEdit displays the first item. This is a problem since the displayed value does not match the actual value.

This issue mostly occurs with initial values (null, empty, etc) when the model is initialised and nothing has yet been set yet, or due to a logic change previous set values are no longer in the list

Options :

(1) Allow users to set Visibility on SelectItem so we can do this :

<SelectItem Value="default(int)" style="display:none;">None</SelectItem>

Then the initial value is initially set to this item, and displayed in the select as "None", but once the user selects away from this default SelectItem its no longer visible/selectable. Visibility was fixed here ( #183 ) but not for SelectItem

as a work-around, I'm doing this now, but using your Class since the style is not available for us (yet).

(2) Allow us to set the title attribute on the select (but this option is mostly used if none of the items match - not necessarily if it matches the default) say by a property on the "SelectEdit" which allows us to specify what to display if nothing is selected, like this:

<SelectEdit NothingSelectedText="None" SelectedValue="0"
    <SelectItem Value="1">one</SelectItem>
    <SelectItem Value="2">two</SelectItem>
    <SelectItem Value="3">three</SelectItem>
</SelectEdit>

Then in this case the select would display "None" (not "one" as currently). In this case you'd
Then you'd have to add the add the title yourself

Preferred : allow all options

@brettwinters brettwinters changed the title SelectEdit : Nothing Matches SelectEdit : Handling for No-Match Sep 12, 2019
@stsrki
Copy link
Collaborator

stsrki commented Sep 12, 2019

If I understood you correctly you want to have an item field that will internally be used to represent an empty or default item? So for example if NothingSelectedText attribute is used than there would need to be created SelectItem with default value and NothingSelectedText for the display?

@stsrki
Copy link
Collaborator

stsrki commented Sep 12, 2019

I think your first example is the best way to go for, as it's not hiding a behavior from other developers.

@brettwinters
Copy link
Author

yes, you understood correct.

Yes, agreed

@stsrki stsrki added the Type: Feature ⚙ Request or idea for a new feature. label Sep 12, 2019
@stsrki stsrki added this to Backlog in Development via automation Sep 12, 2019
@stsrki stsrki added this to the 0.8.5 milestone Sep 12, 2019
@stsrki
Copy link
Collaborator

stsrki commented Sep 12, 2019

Going to 0.8.5 since it is pretty easy to do.

@stsrki stsrki moved this from Backlog to To do in Development Sep 12, 2019
@stsrki stsrki moved this from To do to In progress in Development Sep 14, 2019
@stsrki stsrki closed this as completed Sep 14, 2019
Development automation moved this from In progress to Done Sep 14, 2019
@stsrki stsrki mentioned this issue Sep 18, 2019
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature ⚙ Request or idea for a new feature.
Projects
Development
  
✔ Done
Development

No branches or pull requests

2 participants