ni / nimble

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

Revert previous change as this causes a regression in Angular apps. #2176

Closed atmgrifter00 closed 3 weeks ago

atmgrifter00 commented 3 weeks ago

Pull Request

🤨 Rationale

👩‍💻 Implementation

When putting in the changes to have the Select respond to changes to a ListOptionGroups slotted content, I made it so that if the selected option was removed, that the selectedIndex would get set to -1, and just have setDefaultSelectedOption handle setting the value. So, if a previous value had been set it was essentially forgotten about. This works except for the case where the value is set before any options have been slotted, which happens in an Angular environment commonly.

For now, I'm just removing the logic change and the two tests I wrote to verify the new behavior I was trying to promote. The result of this is that if one removes the selected option from a Select that it won't change its value. I don't think this is correct behavior (as the native select does not do this), so I will file an issue to track this problem, but will note the Angular case to ensure we don't repeat the same implementation.

🧪 Testing

Just removed some tests that were added along with the breaking change.

✅ Checklist