@@ -124,12 +124,10 @@ The `pressIn` and `pressOut` events are sent by default but can be skipped by pa
124
124
**Typing (for each character)**:
125
125
126
126
- ` keyPress `
127
- - ` textInput ` (optional)
128
127
- ` change `
129
128
- ` changeText `
130
129
- ` selectionChange `
131
-
132
- The ` textInput ` event is sent only for multiline text inputs.
130
+ - ` contentSizeChange ` (only multiline)
133
131
134
132
**Leaving the element**:
135
133
@@ -144,7 +142,7 @@ The `submitEditing` event is skipped by default. It can sent by setting the `sub
144
142
` ` ` ts
145
143
clear (
146
144
element : ReactTestInstance ,
147
- }
145
+ )
148
146
` ` `
149
147
150
148
Example
@@ -160,8 +158,6 @@ This function supports only host `TextInput` elements. Passing other element typ
160
158
161
159
### Sequence of events
162
160
163
- The sequence of events depends on the ` multiline ` prop and passed options.
164
-
165
161
Events will not be emitted if the ` editable ` prop is set to ` false ` .
166
162
167
163
**Entering the element**:
@@ -175,12 +171,52 @@ Events will not be emitted if the `editable` prop is set to `false`.
175
171
**Pressing backspace**:
176
172
177
173
- ` keyPress `
178
- - ` textInput ` (optional)
179
174
- ` change `
180
175
- ` changeText `
181
176
- ` selectionChange `
182
177
183
- The ` textInput ` event is sent only for multiline text inputs.
178
+ **Leaving the element**:
179
+
180
+ - ` endEditing `
181
+ - ` blur `
182
+
183
+ ## ` paste ()`
184
+
185
+ ` ` ` ts
186
+ paste (
187
+ element : ReactTestInstance ,
188
+ text : string ,
189
+ )
190
+ ` ` `
191
+
192
+ Example
193
+
194
+ ` ` ` ts
195
+ const user = userEvent .setup ();
196
+ await user .paste (textInput , ' Text to paste' );
197
+ ` ` `
198
+
199
+ This helper simulates the user pasting given text to a ` TextInput ` element.
200
+
201
+ This function supports only host ` TextInput ` elements. Passing other element types will result in throwing an error.
202
+
203
+ ### Sequence of events
204
+
205
+ Events will not be emitted if the ` editable ` prop is set to ` false ` .
206
+
207
+ **Entering the element**:
208
+
209
+ - ` focus `
210
+
211
+ **Selecting all content**:
212
+
213
+ - ` selectionChange `
214
+
215
+ **Pasting the text**:
216
+
217
+ - ` change `
218
+ - ` changeText `
219
+ - ` selectionChange `
184
220
185
221
**Leaving the element**:
186
222
0 commit comments