I would like to know if there is a way to print the selected value of a Dropdown menu that is inside the Property Pane in SPFX.

Like, in my case, how to make it print with a console.log "Ascending" or "Descending" when selected from the Dropdown, or at least the respective key ('ASC' or 'DES')

Here is my code:

    label: "Sort by",  
    options: [
        { key: 'ASC', text: 'Ascending' },
        { key: 'DES', text: 'Descending' }
    selectedKey: strings.SelectedKeyDropdown,

Here is a screenshoot of my Dropdown

enter image description here

  • Which framework are you using, ReactJS?
    – willman
    Mar 19, 2020 at 20:46
  • Pure Sharepoint Framework, nothing else Mar 19, 2020 at 20:54
  • Or, willman, if you know a way of doing it using React I will really appreciate it if you tell me! Mar 19, 2020 at 21:46


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.