Skip to content

Commit 87d9aca

Browse files
committed
Cleanup element classes and attributes on unbound
1 parent ea0e9cf commit 87d9aca

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

webextensions/common/Tab.js

+8
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,14 @@ export default class Tab {
207207

208208
unbindElement() {
209209
if (this.element) {
210+
for (const state of this.states) {
211+
this.element.classList.remove(state);
212+
if (state == Constants.kTAB_STATE_HIGHLIGHTED)
213+
this.element.removeAttribute('aria-selected');
214+
}
215+
for (const key of Object.keys(this.attributes)) {
216+
this.element.removeAttribute(name);
217+
}
210218
this.element.$TST = null;
211219
this.element.apiTab = null;
212220
}

0 commit comments

Comments
 (0)