-
-
Notifications
You must be signed in to change notification settings - Fork 84
Closed
Labels
Description
Reproduction link
No response
Bug description
In https://github.com/csstools/postcss-plugins/blob/main/plugins/css-blank-pseudo/src/browser.js#L52, the code assumes that element.selectedIndex is always the index of an element in the options array.
When using a select field with attribute multiple, this index can be -1 though. This leads to an Uncaught TypeError: Cannot read properties of undefined (reading 'value')
Minimal Example
<!DOCTYPE html>
<html>
<body>
<select multiple="" required="">
<option value="one">One</option>
<option value="two">Two</option>
<option value="three">Three</option>
</select>
<script src="https://unpkg.com/css-blank-pseudo@6.0.1/dist/browser-global.js"></script>
<script>
cssBlankPseudoInit();
</script>
</body>
</html>Actual Behavior
No response
Expected Behavior
No response
Can you reproduce it with npx @csstools/csstools-cli <plugin-name> minimal-example.css?
None
npx Output
No response
Extra config
No response
What plugin are you experiencing this issue on?
CSS Blank Pseudo
Plugin version
6.0.1
What OS are you experiencing this on?
No response
Node Version
18
Validations
- Follow our Code of Conduct
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Would you like to open a PR for this bug?
- I'm willing to open a PR
romainmenke