mirror of
https://github.com/Choices-js/Choices.git
synced 2026-03-14 22:55:46 +01:00
Ignore ID being passed in for choice/group, fixes some tests
This commit is contained in:
parent
d3620f5987
commit
77f362eb42
4 changed files with 10 additions and 7 deletions
|
|
@ -3233,7 +3233,8 @@ var mapInputToChoice = function (value, allowGroup) {
|
|||
return (0, exports.mapInputToChoice)(e, false);
|
||||
});
|
||||
var result_2 = {
|
||||
id: group.id || 0,
|
||||
id: 0,
|
||||
// actual ID will be assigned during _addGroup
|
||||
label: (0, utils_1.unwrapStringForRaw)(group.label) || group.value,
|
||||
active: choices.length !== 0,
|
||||
disabled: !!group.disabled,
|
||||
|
|
@ -3243,8 +3244,10 @@ var mapInputToChoice = function (value, allowGroup) {
|
|||
}
|
||||
var choice = groupOrChoice;
|
||||
var result = {
|
||||
id: choice.id || 0,
|
||||
id: 0,
|
||||
// actual ID will be assigned during _addChoice
|
||||
groupId: 0,
|
||||
// actual ID will be assigned during _addGroup but before _addChoice
|
||||
value: choice.value,
|
||||
label: choice.label || choice.value,
|
||||
active: coerceBool(choice.active),
|
||||
|
|
|
|||
2
public/assets/scripts/choices.min.js
vendored
2
public/assets/scripts/choices.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -36,7 +36,7 @@ export const mapInputToChoice = <T extends string | InputChoice | InputGroup>(
|
|||
const choices = group.choices.map((e) => mapInputToChoice(e, false));
|
||||
|
||||
const result: GroupFull = {
|
||||
id: group.id || 0,
|
||||
id: 0, // actual ID will be assigned during _addGroup
|
||||
label: unwrapStringForRaw(group.label) || group.value,
|
||||
active: choices.length !== 0,
|
||||
disabled: !!group.disabled,
|
||||
|
|
@ -49,8 +49,8 @@ export const mapInputToChoice = <T extends string | InputChoice | InputGroup>(
|
|||
const choice = groupOrChoice;
|
||||
|
||||
const result: ChoiceFull = {
|
||||
id: choice.id || 0,
|
||||
groupId: 0,
|
||||
id: 0, // actual ID will be assigned during _addChoice
|
||||
groupId: 0, // actual ID will be assigned during _addGroup but before _addChoice
|
||||
value: choice.value,
|
||||
label: choice.label || choice.value,
|
||||
active: coerceBool(choice.active),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue