mirror of
				https://github.com/excalidraw/excalidraw.git
				synced 2025-11-04 04:44:31 +01:00 
			
		
		
		
	fix: pasting images on firefox (#4085)
This commit is contained in:
		@@ -1257,10 +1257,13 @@ class App extends React.Component<AppProps, AppState> {
 | 
			
		||||
        return;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      const data = await parseClipboard(event);
 | 
			
		||||
 | 
			
		||||
      // must be called in the same frame (thus before any awaits) as the paste
 | 
			
		||||
      // event else some browsers (FF...) will clear the clipboardData
 | 
			
		||||
      // (something something security)
 | 
			
		||||
      let file = event?.clipboardData?.files[0];
 | 
			
		||||
 | 
			
		||||
      const data = await parseClipboard(event);
 | 
			
		||||
 | 
			
		||||
      if (!file && data.text) {
 | 
			
		||||
        const string = data.text.trim();
 | 
			
		||||
        if (string.startsWith("<svg") && string.endsWith("</svg>")) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user