File tree Expand file tree Collapse file tree 3 files changed +14
-6
lines changed Expand file tree Collapse file tree 3 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -238,10 +238,11 @@ class Toastify {
238
238
// Adding a close icon to the toast
239
239
if ( this . options . close === true ) {
240
240
// Create a span for close element
241
- let closeElement = document . createElement ( "span " ) ;
242
- closeElement . innerHTML = "✖ " ;
243
-
241
+ let closeElement = document . createElement ( "button " ) ;
242
+ closeElement . type = "button " ;
243
+ closeElement . setAttribute ( "aria-label" , "Close" ) ;
244
244
closeElement . className = "toast-close" ;
245
+ closeElement . innerHTML = "✖" ;
245
246
246
247
// Triggering the removal of toast from DOM on close click
247
248
closeElement . addEventListener (
Original file line number Diff line number Diff line change 28
28
}
29
29
30
30
.toast-close {
31
+ background : transparent;
32
+ border : 0 ;
33
+ color : white;
34
+ cursor : pointer;
35
+ font-family : inherit;
36
+ font-size : 1em ;
31
37
opacity : 0.4 ;
32
38
padding : 0 5px ;
33
39
}
Original file line number Diff line number Diff line change 160
160
// Adding a close icon to the toast
161
161
if ( this . options . close === true ) {
162
162
// Create a span for close element
163
- var closeElement = document . createElement ( "span " ) ;
164
- closeElement . innerHTML = "✖ " ;
165
-
163
+ var closeElement = document . createElement ( "button " ) ;
164
+ closeElement . type = "button " ;
165
+ closeElement . setAttribute ( "aria-label" , "Close" ) ;
166
166
closeElement . className = "toast-close" ;
167
+ closeElement . innerHTML = "✖" ;
167
168
168
169
// Triggering the removal of toast from DOM on close click
169
170
closeElement . addEventListener (
You can’t perform that action at this time.
0 commit comments