You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I'm trying to implement a simple input to my channel where I can set a list of supported calling codes, such as 1, 60 and 61. but I encounter an issue where the input from the admin UI will send a number type instead of a string to the backend on one of the values.
I tried searching for an issue with this, but I could not find anything related to this issue.
To Reproduce
Steps to reproduce the behaviour:
Add this to your channel's custom field
config.customFields.Channel.push({
name: "supportedNumbers"
type: "string",
label: [{ languageCode: LanguageCode.en, value: "Supported Phone Number" }],
ui: { component: "select-form-input" },
list: true,
options: [
// Usually we get this list from a library, but we
// can hard code it for now
{
value: "1",
label: [{ languageCode: LanguageCode.en, value: "US" }]
},
{
value: "60",
label: [{ languageCode: LanguageCode.en, value: "MY" }]
},
{
value: "61",
label: [{ languageCode: LanguageCode.en, value: "SG" }]
}
]
})
generate your migration
open the admin UI and navigate to any channel config page
you can see the custom field input looks weird
try add one input
update, there's no issue so far, only ui bug
Now add another one, ui is still bugged
press update after making the changes
See error (note: for testing purposes, I call my customfield as e)
Expected behavior
It should allow the US, SG or MY, and should not make one of the inputs into a number, it should be a string.
Environment (please complete the following information):
@vendure/core version: 3.0.3
Nodejs version: 18.2.3
Database (mysql/postgres etc): postgres 16
Additional context
My guts tell me it's one of those javascript weirdness that causes this issue, this is because if i change my input value to +1, instead of 1, the UI will work, and the bug won't appear.
The text was updated successfully, but these errors were encountered:
Describe the bug
I'm trying to implement a simple input to my channel where I can set a list of supported calling codes, such as
1
,60
and61
. but I encounter an issue where the input from the admin UI will send a number type instead of a string to the backend on one of the values.I tried searching for an issue with this, but I could not find anything related to this issue.
To Reproduce
Steps to reproduce the behaviour:
e
)Expected behavior
It should allow the US, SG or MY, and should not make one of the inputs into a number, it should be a string.
Environment (please complete the following information):
Additional context
My guts tell me it's one of those javascript weirdness that causes this issue, this is because if i change my input value to
+1
, instead of1
, the UI will work, and the bug won't appear.The text was updated successfully, but these errors were encountered: