1

I am trying to use Fast UI controls with React and TypeScript. I followed the React integration instructions, but my onChange events are not triggering. What am I missing?

The onClick event is working on the checkbox, but onChange is really what I am after.

My code:

import { 
  provideFASTDesignSystem, 
  fastCheckbox,
  fastSelect,
  fastOption
} from '@microsoft/fast-components';
import { provideReactWrapper } from '@microsoft/fast-react-wrapper';

const { wrap } = provideReactWrapper(
  React, 
  provideFASTDesignSystem()
);

const FastCheckbox = wrap(fastCheckbox());
const FastSelect = wrap(fastSelect());
const FastOption = wrap(fastOption());
<FastCheckbox 
  checked={props.properties["fieldsetCheckbox"]}
  onChange={(e: any) => {console.log("onChange");}
/>
<FastSelect
  value={props.properties["fieldsetCascadingSelect"][0]}
  onchange={(e: any) => {console.log("onchange");}}
>
  <FastOption value="">Select Family...</FastOption>
  {familiesList.map(item => <FastOption value={item.value}>{item.name}</FastOption>)}
</FastSelect>
Christophe
  • 27,383
  • 28
  • 97
  • 140

1 Answers1

0

If the FAST select element implements all of the functionality of a normal select HTML element, then you may find onselect is what you're looking for

https://developer.mozilla.org/en-US/docs/Web/API/Element/select_event

Bradley
  • 1,234
  • 1
  • 12
  • 24
  • 1
    I double checked MDN, the events fired by a normal – Christophe Jan 22 '22 at 21:06