@@ -129,9 +129,11 @@ trait Simulate extends Object {
129
129
// NOTE: Do not use UndefOr for arguments below; undefined causes Phantom-bloody-JS to crash.
130
130
// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
131
131
132
- case class ChangeEventData (value : String = " " ) {
132
+ case class ChangeEventData (value : String = " " ,
133
+ defaultPrevented : Boolean = false ) {
133
134
def toJs : Object = {
134
135
val t = Dynamic .literal()
136
+ t.updateDynamic(" defaultPrevented" )(defaultPrevented)
135
137
t.updateDynamic(" value" )(value)
136
138
val o = Dynamic .literal(" target" -> t)
137
139
o
@@ -140,30 +142,32 @@ case class ChangeEventData(value: String = "") {
140
142
def simulation = Simulation .change(this )
141
143
}
142
144
143
- case class KeyboardEventData (key : String = " " ,
144
- location : Double = 0 ,
145
- altKey : Boolean = false ,
146
- ctrlKey : Boolean = false ,
147
- metaKey : Boolean = false ,
148
- shiftKey : Boolean = false ,
149
- repeat : Boolean = false ,
150
- locale : String = " " ,
151
- keyCode : Int = 0 ,
152
- charCode : Int = 0 ,
153
- which : Int = 0 ) {
145
+ case class KeyboardEventData (key : String = " " ,
146
+ location : Double = 0 ,
147
+ altKey : Boolean = false ,
148
+ ctrlKey : Boolean = false ,
149
+ metaKey : Boolean = false ,
150
+ shiftKey : Boolean = false ,
151
+ repeat : Boolean = false ,
152
+ locale : String = " " ,
153
+ keyCode : Int = 0 ,
154
+ charCode : Int = 0 ,
155
+ which : Int = 0 ,
156
+ defaultPrevented : Boolean = false ) {
154
157
def toJs : Object = {
155
158
val o = Dynamic .literal()
156
- o.updateDynamic(" key" )(key )
157
- o.updateDynamic(" location" )(location)
158
- o.updateDynamic(" altKey" )(altKey )
159
- o.updateDynamic(" ctrlKey" )(ctrlKey )
160
- o.updateDynamic(" metaKey" )(metaKey )
161
- o.updateDynamic(" shiftKey" )(shiftKey)
162
- o.updateDynamic(" repeat" )(repeat )
163
- o.updateDynamic(" locale" )(locale )
164
- o.updateDynamic(" keyCode" )(keyCode )
165
- o.updateDynamic(" charCode" )(charCode)
166
- o.updateDynamic(" which" )(which )
159
+ o.updateDynamic(" key" )(key )
160
+ o.updateDynamic(" location" )(location )
161
+ o.updateDynamic(" altKey" )(altKey )
162
+ o.updateDynamic(" ctrlKey" )(ctrlKey )
163
+ o.updateDynamic(" metaKey" )(metaKey )
164
+ o.updateDynamic(" shiftKey" )(shiftKey )
165
+ o.updateDynamic(" repeat" )(repeat )
166
+ o.updateDynamic(" locale" )(locale )
167
+ o.updateDynamic(" keyCode" )(keyCode )
168
+ o.updateDynamic(" charCode" )(charCode )
169
+ o.updateDynamic(" which" )(which )
170
+ o.updateDynamic(" defaultPrevented" )(defaultPrevented)
167
171
o
168
172
}
169
173
def simulateKeyDown (t : ReactOrDomNode ): Unit = ReactTestUtils .Simulate .keyDown (t, this )
@@ -178,32 +182,34 @@ case class KeyboardEventData(key: String = "",
178
182
def simulationKeyDownPressUp = simulationKeyDown >> simulationKeyPress >> simulationKeyUp
179
183
}
180
184
181
- case class MouseEventData (screenX : Double = 0 ,
182
- screenY : Double = 0 ,
183
- clientX : Double = 0 ,
184
- clientY : Double = 0 ,
185
- pageX : Double = 0 ,
186
- pageY : Double = 0 ,
187
- altKey : Boolean = false ,
188
- ctrlKey : Boolean = false ,
189
- metaKey : Boolean = false ,
190
- shiftKey : Boolean = false ,
191
- button : Int = 0 ,
192
- buttons : Int = 0 ) {
185
+ case class MouseEventData (screenX : Double = 0 ,
186
+ screenY : Double = 0 ,
187
+ clientX : Double = 0 ,
188
+ clientY : Double = 0 ,
189
+ pageX : Double = 0 ,
190
+ pageY : Double = 0 ,
191
+ altKey : Boolean = false ,
192
+ ctrlKey : Boolean = false ,
193
+ metaKey : Boolean = false ,
194
+ shiftKey : Boolean = false ,
195
+ button : Int = 0 ,
196
+ buttons : Int = 0 ,
197
+ defaultPrevented : Boolean = false ) {
193
198
def toJs : Object = {
194
199
val o = Dynamic .literal()
195
- o.updateDynamic(" screenX" )(screenX )
196
- o.updateDynamic(" screenY" )(screenY )
197
- o.updateDynamic(" clientX" )(clientX )
198
- o.updateDynamic(" clientY" )(clientY )
199
- o.updateDynamic(" pageX" )(pageX )
200
- o.updateDynamic(" pageY" )(pageY )
201
- o.updateDynamic(" altKey" )(altKey )
202
- o.updateDynamic(" ctrlKey" )(ctrlKey )
203
- o.updateDynamic(" metaKey" )(metaKey )
204
- o.updateDynamic(" shiftKey" )(shiftKey)
205
- o.updateDynamic(" button" )(button )
206
- o.updateDynamic(" buttons" )(buttons )
200
+ o.updateDynamic(" screenX" )(screenX )
201
+ o.updateDynamic(" screenY" )(screenY )
202
+ o.updateDynamic(" clientX" )(clientX )
203
+ o.updateDynamic(" clientY" )(clientY )
204
+ o.updateDynamic(" pageX" )(pageX )
205
+ o.updateDynamic(" pageY" )(pageY )
206
+ o.updateDynamic(" altKey" )(altKey )
207
+ o.updateDynamic(" ctrlKey" )(ctrlKey )
208
+ o.updateDynamic(" metaKey" )(metaKey )
209
+ o.updateDynamic(" shiftKey" )(shiftKey )
210
+ o.updateDynamic(" button" )(button )
211
+ o.updateDynamic(" buttons" )(buttons )
212
+ o.updateDynamic(" defaultPrevented" )(defaultPrevented)
207
213
o
208
214
}
209
215
def simulateDrag (t : ReactOrDomNode ) = ReactTestUtils .Simulate .drag (t, this )
@@ -213,6 +219,7 @@ case class MouseEventData(screenX: Double = 0,
213
219
def simulateDragLeave (t : ReactOrDomNode ) = ReactTestUtils .Simulate .dragLeave (t, this )
214
220
def simulateDragOver (t : ReactOrDomNode ) = ReactTestUtils .Simulate .dragOver (t, this )
215
221
def simulateDragStart (t : ReactOrDomNode ) = ReactTestUtils .Simulate .dragStart (t, this )
222
+ def simulateDrop (t : ReactOrDomNode ) = ReactTestUtils .Simulate .drop (t, this )
216
223
def simulateMouseDown (t : ReactOrDomNode ) = ReactTestUtils .Simulate .mouseDown (t, this )
217
224
def simulateMouseEnter (t : ReactOrDomNode ) = ReactTestUtils .Simulate .mouseEnter(t, this )
218
225
def simulateMouseLeave (t : ReactOrDomNode ) = ReactTestUtils .Simulate .mouseLeave(t, this )
0 commit comments