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

optionValue and dataKey combination is broken is Select Components #90

Closed
fairking opened this issue Nov 20, 2019 · 7 comments
Closed
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@fairking
Copy link

fairking commented Nov 20, 2019

I am trying to bind a single value but looks like it is not working. Could you please look if I my code is correct.
My example:

export class DropdownItem {
    id: string;
    name: string;
}
data() {
    return {
        selectedItemId: String,
        dropdownList: DropdownItem[],
    };
},
<Dropdown v-model="selectedItemId" :options="dropdownList" option-value="id" option-label="name" placeholder="Select an Item" />

P.S. It would be nice to have some sandbox like https://jsfiddle.net/ so you can check the example.

@fairking fairking changed the title Dropdown bind single value not working Dropdown binding a single value is not working Nov 20, 2019
@fairking
Copy link
Author

Looks like it is working. Closing the issue. Will figure out on my side what is wrong. Sorry for the perturbation.
This is my working jsfiddle https://jsfiddle.net/FairKing/esLawbdq/1/

@fairking
Copy link
Author

fairking commented Dec 10, 2019

Dropdown stops working with the following configuration:

<Dropdown v-model="dropdownCity"
    :options="dropdownCities"
    option-label="name"
    option-value="code"
    data-key="code"
    placeholder="Select a City" />

The issue is "data-key" property. If I remove it everything is working fine.

image

@fairking fairking reopened this Dec 10, 2019
@cagataycivici
Copy link
Member

Could you please share your code that reproduces the issue?

@fairking
Copy link
Author

The issue happens when both attributes are applied: option-value and data-key.

@cagataycivici
Copy link
Member

Could you please share sample code that reproduces the issue?

@fairking
Copy link
Author

@cagataycivici cagataycivici self-assigned this Jan 20, 2020
@cagataycivici cagataycivici added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Jan 20, 2020
@cagataycivici cagataycivici added this to the 1.0.1 milestone Jan 20, 2020
@cagataycivici cagataycivici changed the title Dropdown binding a single value is not working optionValue and dataKey combination is broken is Select Components Jan 21, 2020
@cagataycivici
Copy link
Member

Also affects multiselect, listbox and selectbutton.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

2 participants