Skip to content

Commit

Permalink
Merge pull request capricorn86#549 from obadakhalili/task/548-fix-sel…
Browse files Browse the repository at this point in the history
…ect-selectedIndex-incorrect-logic

capricorn86#548@patch: Fix incorrect logic in selectEl.selectedIndex setter.
  • Loading branch information
capricorn86 committed Jul 24, 2022
2 parents ec5a307 + d4e47b5 commit f7c8a89
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 43 deletions.
84 changes: 42 additions & 42 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export default class HTMLSelectElement extends HTMLElement implements IHTMLSelec
* @param value Value.
*/
public set selectedIndex(value: number) {
if (this.options.length - 1 > value || value < 0) {
if (value > this.options.length - 1 || value < 0) {
throw new DOMException(
'Select elements selected index must be valid',
DOMExceptionNameEnum.indexSizeError
Expand Down

0 comments on commit f7c8a89

Please sign in to comment.