@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414limitations under the License.
1515*/
1616
17- import { KeyboardEvent , RefObject , SyntheticEvent , useCallback , useRef , useState } from "react" ;
17+ import { KeyboardEvent , RefObject , SyntheticEvent , ClipboardEvent , useCallback , useRef , useState } from "react" ;
1818import { Attributes , MappedSuggestion } from "@matrix-org/matrix-wysiwyg" ;
1919import { IEventRelation } from "matrix-js-sdk/src/matrix" ;
2020
@@ -68,8 +68,8 @@ export function usePlainTextListeners(
6868 ref : RefObject < HTMLDivElement > ;
6969 autocompleteRef : React . RefObject < Autocomplete > ;
7070 content ?: string ;
71- onInput ( event : SyntheticEvent < HTMLDivElement , InputEvent | ClipboardEvent > ) : void ;
72- onPaste ( event : SyntheticEvent < HTMLDivElement , InputEvent | ClipboardEvent > ) : void ;
71+ onInput ( event : SyntheticEvent < HTMLDivElement , InputEvent > | ClipboardEvent ) : void ;
72+ onPaste ( event : ClipboardEvent ) : void ;
7373 onKeyDown ( event : KeyboardEvent < HTMLDivElement > ) : void ;
7474 setContent ( text ?: string ) : void ;
7575 handleMention : ( link : string , text : string , attributes : Attributes ) => void ;
@@ -113,7 +113,7 @@ export function usePlainTextListeners(
113113
114114 const enterShouldSend = ! useSettingValue < boolean > ( "MessageComposerInput.ctrlEnterToSend" ) ;
115115 const onInput = useCallback (
116- ( event : SyntheticEvent < HTMLDivElement , InputEvent | ClipboardEvent > ) => {
116+ ( event : SyntheticEvent < HTMLDivElement , InputEvent > | ClipboardEvent ) => {
117117 console . log ( "<<< handling " , event ) ;
118118 if ( isDivElement ( event . target ) ) {
119119 console . log ( "<<< setting " , event . target . innerHTML ) ;
@@ -127,7 +127,7 @@ export function usePlainTextListeners(
127127 ) ;
128128
129129 const onPaste = useCallback (
130- ( event : SyntheticEvent < HTMLDivElement , ClipboardEvent > ) => {
130+ ( event : ClipboardEvent ) => {
131131 const handled = handleClipboardEvent ( event , roomContext , mxClient , eventRelation ) ;
132132 if ( handled ) {
133133 event . preventDefault ( ) ; // we only handle image pasting manually
0 commit comments