Skip to content

Commit

Permalink
\capricorn86#1010@patch: Check HTMLButtonElementNamedNodeMap removedI…
Browse files Browse the repository at this point in the history
…tem is defined before accessing properties.
  • Loading branch information
maxmilton authored and capricorn86 committed Aug 4, 2023
1 parent 941b6df commit e62d2fd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Expand Up @@ -42,6 +42,7 @@ export default class HTMLButtonElementNamedNodeMap extends HTMLElementNamedNodeM
const removedItem = super.removeNamedItem(name);

if (
removedItem &&
(removedItem.name === 'id' || removedItem.name === 'name') &&
this._ownerElement._formNode
) {
Expand Down
Expand Up @@ -75,7 +75,12 @@ describe('HTMLButtonElement', () => {
});

describe(`set disabled()`, () => {
it('Sets attribute value.', () => {
it('Sets attribute value to false.', () => {
element.disabled = false;
expect(element.getAttribute('disabled')).toBe(null);
});

it('Sets attribute value to true.', () => {
element.disabled = true;
expect(element.getAttribute('disabled')).toBe('');
});
Expand Down

0 comments on commit e62d2fd

Please sign in to comment.