Giter Site home page Giter Site logo

Comments (13)

MohamedRejeb avatar MohamedRejeb commented on June 21, 2024

Hi,
This is one of the missing features of the library, I try to provide this in the next release.

Thanks for the detailed suggestions.

from compose-rich-editor.

RujulGandhi avatar RujulGandhi commented on June 21, 2024

Hi,

Thank you for considering of this feature in the next release!

In the meantime, I was wondering if you could share an estimated release date for the next version? Having a rough timeline would help me plan my implementation accordingly.

Additionally, while awaiting the official implementation, do you have any suggestions for alternative methods to observe the '@' character in the text editor? I'd appreciate any guidance or workaround you might have in mind.

Thank you once again for your attention to this matter.

from compose-rich-editor.

MohamedRejeb avatar MohamedRejeb commented on June 21, 2024

Hopefully at the end of this week or the next week.
I think that it's possible now to observe the @ by observing any change and do some text manipulation. Something like this:

LaunchedEffect(state.selection, state.annotatedString) {
    // Use the current text and the cursor position to look for the first @ char before the cursor and then you can get the data that you want.
}

from compose-rich-editor.

RujulGandhi avatar RujulGandhi commented on June 21, 2024

Yes by your given suggestion I am able to observe text, but same way I want to observe that text is getting deleted because in mine case I want to hide Mention popup once someone is deleting @ from Editor. Can you suggest me something.

from compose-rich-editor.

MohamedRejeb avatar MohamedRejeb commented on June 21, 2024

Yes I think that you can do it with the same approach. I would suggest saving the @ index when it gets added to distinguish between multiple mentions. So let's say that you detected that there's an @ before the cursor, save that position when you open the popup, then if the cursor position is lower than the saved mention position, you hide the popup.

from compose-rich-editor.

RujulGandhi avatar RujulGandhi commented on June 21, 2024

I feel storing index of @ will be costly operation because any time user can change anything from contain I have to keep updating my @ index also.

from compose-rich-editor.

MohamedRejeb avatar MohamedRejeb commented on June 21, 2024

You can save it when you open the popup, just with the action of opening the popup. Then if the popup is opened and the cursor position is lower than the @ position, you can close the popup.

from compose-rich-editor.

RujulGandhi avatar RujulGandhi commented on June 21, 2024

yes that might be easier solution. Thanks

from compose-rich-editor.

RujulGandhi avatar RujulGandhi commented on June 21, 2024

@MohamedRejeb this feature you are releasing it in this week Right ?

from compose-rich-editor.

LaatonWalaBhoot avatar LaatonWalaBhoot commented on June 21, 2024

@MohamedRejeb I tried doing this by using Visual Transformation but got nowhere. The offset mapping usually results in regression. Plus deleting items completely screws up spans. There is no span listener in normal textFields. I have searched everywhere, there does not seem to be any working solution for compose anywhere

from compose-rich-editor.

MohamedRejeb avatar MohamedRejeb commented on June 21, 2024

Hi,
The needed APIs for this feature are already implemented but internal for now, I will see if it's possible to expose them with some improvements.

from compose-rich-editor.

LaatonWalaBhoot avatar LaatonWalaBhoot commented on June 21, 2024

https://github.com/linkedin/Spyglass This is already implemented for EditTexts. If you want to have a look at the API design.
I am able to trigger suggestion on @ but adding and removing spans is causing all sorts of issues

from compose-rich-editor.

LaatonWalaBhoot avatar LaatonWalaBhoot commented on June 21, 2024

@MohamedRejeb Any timeline on this feature? It is highly requested by compose users and I don't think there is an existing solution

from compose-rich-editor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.