ni / nimble

The NI Nimble Design System
https://nimble.ni.dev
MIT License
29 stars 9 forks source link

Address issue with select not recognizing when group options are updated. #2162

Closed atmgrifter00 closed 4 weeks ago

atmgrifter00 commented 4 weeks ago

Pull Request

๐Ÿคจ Rationale

Realized from a conversation that the Select wasn't reacting to updates to ListOptionGroup slotted content updates.

๐Ÿ‘ฉโ€๐Ÿ’ป Implementation

Simply needed to have the Select observe the listOption property of the ListOptionGroup elements it owns, and then call slottedOptionsChanged directly. Also required a slight change to how we maintain the currently selected option when the options are changed, particularly for when the selected option is removed.

๐Ÿงช Testing

Added a few unit tests.

โœ… Checklist

rajsite commented 4 weeks ago

@jattasNI is OOO and looks like feedback was addressed so merging