From a2353f4e9d90dde615a9f14a428a93c682356695 Mon Sep 17 00:00:00 2001 From: Theodore Brown Date: Tue, 6 Apr 2021 15:42:30 -0600 Subject: [PATCH] Set selectedIndex to -1 when no option matches bound select value Previously, when the bound value of a select element was set to `null` or any other value not matching one of the options, the first option would appear selected. So even if the select element was `required`, users could submit the form and end up sending a different value than what it appeared they were submitting. With this change, if a select element is bound to a value that doesn't match one of its options, then none of the options will appear selected. This helps catch bugs during development when the bound value inadvertently doesn't match an option. It also makes it possible to bind a `required` select element to `null`, and cause the browser to require users to explicitly select an option before the form can be submitted. Resolves #6126. In order for the test to pass, it was necessary to update the jsdom dependency to the latest 15.x release, since v15.2.0 fixed `selectEl.value` when no `