froala / angular-froala-wysiwyg

Angular 4, 5, 6, 7, 8 and 9 plugin for Froala WYSIWYG HTML Rich Text Editor.
https://froala.com/wysiwyg-editor
729 stars 200 forks source link

Get the character at current caret position #508

Closed boechsle24 closed 10 months ago

boechsle24 commented 1 year ago

Hi to everybody. Is it possible to get the last typed character(s) or the one before where the caret is at the moment? I'm trying to implement a symbol which triggers a popup menu to be shown. The characters after the symbol will filter the results in the shown list and after selecting a entry the trigger symbol and the search string will be replaced by the selected text. For this purpose it would be handy if I can access the last typed character(s) or the one before the current position.

Thank you. Cheers.

ilyaskarim commented 10 months ago

You can refer to our selection API which allows you to get range on different index's: https://froala.com/wysiwyg-editor/docs/methods/#selection