`div.modal-footer` -> `.modal-footer` should be fine here: qualifying class selectors with element type is discouraged, because the element type may change. Also, using `querySelector` with classes or element types (as opposed to IDs) is dangerous, because there can be multiple matches, leading to unpredictability (`querySelectorAll` is better for that). Actually, right here we have just that: there are 2 `spark-button`s in this dialog, so which one is the listener attached to?