We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
microsoft/TypeScript#3960
Tried to make the drop down as a generic component. Didn't work as intended so parking it here.
interface Props<TModel> { dropdownOptions: DropdownItemProps[]; propertyName: keyof TModel; updateProperty: (prop: keyof TModel, value: any, valid: boolean) => void; dropdownValues: LinkObject[]; } export default class LinkObjectValuedDropDownMulti<TModel> extends React.Component<Props<TModel> & DropdownProps, {}> { public render() { return ( < ... /> ); } private onUpdateSelectedProperty = (values: string[], valid: boolean) => { this.props.updateProperty(this.props.propertyName, values.map((v): LinkObject => ({ name: this.props.dropdownOptions.find(d => d.id === v).name, id: v })), valid); } }
Usage
const NamedDropDownMulti = LinkObjectValuedDropDownMulti as (new () => LinkObjectValuedDropDownMulti<NamedModel>);
<WorkGroupDropDownMulti search dynamicOptions dropdownValues={this.state.values.named} label="named" placeholder="named" showErrors={this.state.showErrors} dropdownOptions={this.props.named} updateProperty={this.updateProperty} propertyName="named" onUpdateSelectedProperty={this.onUpdateSelectedProperty} />
The text was updated successfully, but these errors were encountered:
Was having an issue with the this reference on semantic UI
Sorry, something went wrong.
No branches or pull requests
microsoft/TypeScript#3960
Tried to make the drop down as a generic component. Didn't work as intended so parking it here.
Usage
The text was updated successfully, but these errors were encountered: