Remove Empty Value of Native Drop Down

1
Hi experts, I want to remove the empty value of an enumeration in the drop-down used in a native application. We can remove the value in a web by using js. But is there any solution to remove the empty value in native?
asked
2 answers
0

I think your best option would be finding out how React Native shows the values of a dropdown, and find a way to alter this behaviour using TypeScript.

This would be very tricky, because React Native uses the mobile device to show certain widgets. Which means Android and iOS show different widgets for the dropdown for example.

 

Can't you just use validation to check if the empty value is not selected when submitting the form? This would be the simple Mendix solution, and I think should work the way you want it?

 

Hope this helps!

answered
-4

Hi Sasidaran,

 

I find this interesting answer that could be useful in your case.

 

it suggests to add a class remove-emptyfield to the enum dropdown:

 

.remove-emptyfield {
    select>option:first-child {
        display: none;
    }
}

 

let me know if it works :)

Andrea

answered