This repository was archived by the owner on Apr 15, 2024. It is now read-only.
File tree 3 files changed +21
-1
lines changed
3 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 1
1
# Dropd
2
2
3
+ ## v1.1.2 / 2019-04-27
4
+
5
+ - Quick fix
6
+
3
7
## v1.1.1 / 2019-04-27
4
8
5
9
- Makes the ` list ` prop reactive
Original file line number Diff line number Diff line change @@ -32,6 +32,12 @@ class Dropd extends React.PureComponent {
32
32
document . addEventListener ( 'mousedown' , this . closeOnBlurFn , true )
33
33
}
34
34
35
+ componentDidUpdate ( prevProps ) {
36
+ if ( this . props . list !== prevProps . list ) {
37
+ this . setState ( { list : this . props . list } )
38
+ }
39
+ }
40
+
35
41
componentWillUnmount ( ) {
36
42
document . removeEventListener ( 'mousedown' , this . closeOnBlurFn , true )
37
43
}
Original file line number Diff line number Diff line change @@ -88,13 +88,23 @@ import '../helpers/styles.scss'
88
88
89
89
const Dropd = {
90
90
data : () => ({
91
+ CLASSNAMES ,
91
92
open: false ,
92
- internalList : [] ,
93
+ focusBoxStyles ,
93
94
currentItem: null ,
94
95
internalDefaultOpen: false ,
95
96
internalRevealOn: ' mousedown' ,
96
97
}),
97
98
99
+ computed: {
100
+ internalList: {
101
+ set : value => value,
102
+ get : function () {
103
+ return this .list || []
104
+ },
105
+ },
106
+ },
107
+
98
108
created () {
99
109
// Manually update relevant internal states from props.
100
110
this .internalList .push (... this .list )
You can’t perform that action at this time.
0 commit comments