Skip to content
This repository was archived by the owner on Apr 15, 2024. It is now read-only.

Commit fae3234

Browse files
committed
Quick fix
1 parent a27036b commit fae3234

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

HISTORY.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Dropd
22

3+
## v1.1.2 / 2019-04-27
4+
5+
- Quick fix
6+
37
## v1.1.1 / 2019-04-27
48

59
- Makes the `list` prop reactive

packages/react-dropd/index.js

+6
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ class Dropd extends React.PureComponent {
3232
document.addEventListener('mousedown', this.closeOnBlurFn, true)
3333
}
3434

35+
componentDidUpdate(prevProps) {
36+
if (this.props.list !== prevProps.list) {
37+
this.setState({ list: this.props.list })
38+
}
39+
}
40+
3541
componentWillUnmount() {
3642
document.removeEventListener('mousedown', this.closeOnBlurFn, true)
3743
}

packages/vue-dropd/index.vue

+11-1
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,23 @@ import '../helpers/styles.scss'
8888
8989
const Dropd = {
9090
data: () => ({
91+
CLASSNAMES,
9192
open: false,
92-
internalList: [],
93+
focusBoxStyles,
9394
currentItem: null,
9495
internalDefaultOpen: false,
9596
internalRevealOn: 'mousedown',
9697
}),
9798
99+
computed: {
100+
internalList: {
101+
set: value => value,
102+
get: function() {
103+
return this.list || []
104+
},
105+
},
106+
},
107+
98108
created() {
99109
// Manually update relevant internal states from props.
100110
this.internalList.push(...this.list)

0 commit comments

Comments
 (0)