compose-multiplatform icon indicating copy to clipboard operation
compose-multiplatform copied to clipboard

Compose for Web: Copy & paste support for TextField

Open StefanOltmann opened this issue 2 years ago • 7 comments

On the desktop version, there is a context menu offering options such as "cut", "copy", "paste" and "select all" complemented by convenient shortcuts like CMD+C and CMD+V.

It appears that a similar functionality is currently absent in the Compose for Web interface.

StefanOltmann avatar Dec 13 '23 21:12 StefanOltmann

Yes, we are going to support it in the future 👍

terrakok avatar Dec 14 '23 13:12 terrakok

Hello, @terrakok as we are in the subject of text selection, what about text search browser feature ? for example on Chrome i guess it's text based on html, what about when ui is in a canvas ? could image analyzing/almost ai help here for example for identifying text but it would be on browser side ? and others thing such as when content is out of screen/not drawn, or there are others possible ways for making this work

usert-4 avatar Dec 28 '23 11:12 usert-4

what about text search browser feature

if this feature becomes available at some point, it probably won't work same way it works in Chrome with html pages.

It's more likely to work like in google docs, and I'd say it's a feature that an app implementation should take care of.

Currently, it's not planned, but can be considered.

eymar avatar Dec 28 '23 11:12 eymar

yes, we could also imagine a system where Compose place html tag informations on the elements in the canvas(location etc..), i also thinked about such thing for debugging/testing purpose, but that's almost another subject that could be seen later, thanks

usert-4 avatar Dec 28 '23 11:12 usert-4

any idea on the timescale...when will this get supported ?

dhakehurst avatar Feb 01 '24 09:02 dhakehurst

any idea on the timescale...when will this get supported ?

We aim to make it properly implemented in 1.7 version of Compose Multiplatform.

eymar avatar Feb 01 '24 09:02 eymar

I think paste not working in web version , I must enter all data, is this issue solved or included in current issue ?

MahmoudMabrok avatar Feb 04 '24 05:02 MahmoudMabrok

yes, it's very annoying that cut/paste doesn't work on compose web

dbaroncelli avatar Mar 13 '24 13:03 dbaroncelli

@usert-4 Actually that's needed for accessibility as well, so both of these are likely going to be implemented at the same time.

skaldebane avatar Mar 25 '24 10:03 skaldebane

We aim to make it properly implemented in 1.7 version of Compose Multiplatform.

Just wondering if Hiragana/Katakana support is in scope for the release with cut/copy/paste support? At the moment, Hiragana and Katakana inputs on MacOS show up as Romaji. h + e should become but ends up as he

tombaileywzd avatar Mar 26 '24 11:03 tombaileywzd

@tombaileywzd than you for this report, we haven't tested clipoard events with hiragana/katakana so far, we definitely want to support it (general-purpose framework that does not support Unicode to full extent will be, well, no so general-purpose). As of the actual time framework it's just difficult to estimate. But we'll get there. Also, I'll create a task not to forget add specific test case to cover your scenario.

Schahen avatar Mar 26 '24 13:03 Schahen

Does someone have a workaround?

dmentx avatar Jul 09 '24 21:07 dmentx

@Schahen I think this relates to supporting input methods in general. Browsers tell input methods that they do support them (which they do in normal HTML), and so Compose Web has to integrate with that somehow.

Interestingly, Compose Desktop doesn't show the intermediate text and suggestions inline, but it works nevertheless. I may be totally wrong, but I assume this is because Compose Desktop doesn't announce that it supports IMEs at all, and so they work in this sort of fallback mode where the text is prepared in a small system pop-up before inputting the final result into the app. Just a wild guess, I really have no idea how IMEs work, but that's how it behaves on desktop (Linux). This is kind of a separate thing but I just thought it was interesting.

Flutter Web (wasm) seems to support this, and can be tested in any text field in the Material 3 demo: https://flutterweb-wasm.web.app/. There seems to be no Japanese font so it all ends up as tofu (the little squares), but the IME is clearly working and replacing characters inline. Maybe you can draw from their implementation.

skaldebane avatar Jul 10 '24 08:07 skaldebane