{
backgroundColor: `lightcyan`
}}>
- {ambitSeleccionat &&
{ambitSeleccionat}
}
+ {ambitSeleccionat &&
{ambitSeleccionat?.value}
}
Codis
Tria el rol que adquirirà qui utilitze el codi.
@@ -140,6 +141,7 @@ export const Codis = () => {
name="selAmbit"
// formatCreateLabel={(inputValue) => "Crear nou tipus..."}
// filterOption={filterAmbit}
+ defaultValue={ambitSeleccionat}
options={
[...
ambits
@@ -157,9 +159,9 @@ export const Codis = () => {
// onCreateOption={(inputValue) => Meteor.callAsync('afigT', {titol: inputValue})}
isSearchable
// loadOptions={tipus.map((v,i) => ({value: v, label: v.titol}))}
- onChange={ev => {
- ambitSeleccionat = ev.value;
- console.log("ambitSeleccionat: ", ambitSeleccionat);
+ onChange={amb => {
+ setAmbitSeleccionat(amb);
+ console.log("amb: ", amb);
}}
/>
@@ -178,14 +180,14 @@ export const Codis = () => {
-
-
+
+
-
-
-
({value: v._id, label: v.nomPoble})) } />
+
+
+
{/*