Commit 1566ec1 1 parent efd89f5 commit 1566ec1 Copy full SHA for 1566ec1
File tree 3 files changed +10
-7
lines changed
3 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 1
1
## Release History
2
+ * ** 0.4.5**
3
+ * 🐞 ` BUGFIX ` Modal focus correctly focuses on non close trigger when possible
4
+ * 🐞 ` BUGFIX ` Custom open class is now properly removed on modal close
2
5
* ** 0.4.4**
3
6
* 💡 ` FEATURE ` Added ability to customize open class name
4
7
* ** 0.4.3**
Original file line number Diff line number Diff line change @@ -150,13 +150,13 @@ const MicroModal = (() => {
150
150
setFocusToFirstNode ( ) {
151
151
if ( this . config . disableFocus ) return
152
152
153
- const focusableNodes = this . getFocusableNodes ( )
153
+ let focusableNodes = this . getFocusableNodes ( )
154
154
155
- // could not think of a better name :(
156
- const nodesWhichAreNotCloseTargets = focusableNodes . filter ( node => ! node . hasAttribute ( 'data-micromodal-close' ) )
155
+ // Filters nodes which are close targets
156
+ focusableNodes = focusableNodes . filter ( node => ! node . hasAttribute ( this . config . closeTrigger ) )
157
157
158
- if ( nodesWhichAreNotCloseTargets . length > 0 ) nodesWhichAreNotCloseTargets [ 0 ] . focus ( )
159
- if ( nodesWhichAreNotCloseTargets . length === 0 ) focusableNodes [ 0 ] . focus ( )
158
+ if ( focusableNodes . length > 0 ) focusableNodes [ 0 ] . focus ( )
159
+ if ( focusableNodes . length === 0 ) focusableNodes [ 0 ] . focus ( )
160
160
}
161
161
162
162
retainFocus ( event ) {
Original file line number Diff line number Diff line change 17
17
"build" : " yarn lib:build && yarn docs:build" ,
18
18
"deploy:npm" : " yarn workspace micromodal publish" ,
19
19
"deploy:docs" : " yarn workspace @micromodal/docs deploy" ,
20
- "lib:dev" : " yarn workspace micromodal dev" ,
21
- "lib:build" : " yarn workspace micromodal build" ,
22
20
"docs:dev" : " yarn workspace @micromodal/docs dev" ,
23
21
"docs:build" : " yarn workspace @micromodal/docs build" ,
22
+ "lib:dev" : " yarn workspace micromodal dev" ,
23
+ "lib:build" : " yarn workspace micromodal build" ,
24
24
"test" : " yarn workspace @micromodal/tests cypress:cli" ,
25
25
"test:serve" : " yarn workspace @micromodal/tests serve" ,
26
26
"test:gui" : " yarn workspace @micromodal/tests cypress:open"
You can’t perform that action at this time.
0 commit comments