I am creating an SPFX form and have managed to create a handler function that 'handles' multiple different text fields, but now I need a handler that can cater for multiple different drop down fields. I am using Microsoft Fabric UI.
The major issue is that for every textField a 'name' property can be called upon so the handler knows which textfield is which. A drop down doesn't have such a field. So how would I code a handler to cater for a drop down?
Here's my existing handler:
public onDropDownChange = (evt: any) => {
const {value} = (evt.target as any);
// const selectedItem = ((item && item.key) ? item.key.toString(): null );
//What to put!!?
this.setState({
});
console.log(value);
}Any ideas on how to make a handler accept drop downs when they don't have a unique identifier like a textfield has?