Skip to content

Commit 6ee44d9

Browse files
committed
Add close target to slideover with animations
1 parent e926a95 commit 6ee44d9

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# 4.0.1
44

55
* Tabs index now selects panels and no longer requires tabs
6+
* Add closeTarget to Slideover
67

78
# 4.0.0
89

src/slideover.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ import Dropdown from './dropdown.js'
22
import { toggleWithState } from './transition'
33

44
export default class extends Dropdown {
5-
static targets = ['menu', 'overlay']
5+
static targets = ['menu', 'overlay', 'close']
66

77
openValueChanged() {
88
toggleWithState(this.overlayTarget, this.openValue)
99
toggleWithState(this.menuTarget, this.openValue)
10+
if (this.hasCloseTarget) toggleWithState(this.closeTarget, this.openValue)
1011
}
1112
}

0 commit comments

Comments
 (0)