Skip to content

Commit

Permalink
Merge branch 'clipboard-post-handler' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmz committed Oct 8, 2024
2 parents 291f73e + e6d041f commit 0be1ac7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Experimental
## [1.135.0] - Not released
### Added
- The PWA manifest and the service worker was added. The service worker caches
all site assets, including web fonts. It also caches user profile pictures (up
to 100 entries). The AppUpdated component periodically checks the service
worker for update.
### Fixed
- The SmartTextarea component now handles the 'onPaste' event more precisely.
When the clipboard contains the text and the image in the same time, both are
pasted.

## [1.134.4] - 2024-08-26
### Changed
Expand Down
8 changes: 0 additions & 8 deletions src/components/smart-textarea.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,6 @@ function useFile(onFile, ref) {

const items = [...e.clipboardData.items];

// If there is some plain text in clipboard, use it and don't try to find image
if (items.some((it) => it.type.startsWith('text/plain'))) {
return;
}

const imagePromises = [];
for (const it of items) {
if (!it.type.startsWith('image/')) {
Expand All @@ -208,9 +203,6 @@ function useFile(onFile, ref) {
imagePromises.push(Promise.resolve(blob));
}
}
if (imagePromises.length > 0) {
e.preventDefault();
}

// Call 'onFile' in order of imagePromises
imagePromises.reduce(async (prev, it) => {
Expand Down

0 comments on commit 0be1ac7

Please sign in to comment.