LV_DRAW_LABEL_NO_TXT_SEL is the value set when you call lv_textarea_clear_selection, so if either start or end are set to this, there is no selection, so shouldn’t “text_is_selected” return false, not true?
P.S. In the v8.0.0. documentation for Keyboard, the example “Keyboard with text area” has a broken link for the code. I’m having general issues trying to highlight text in a text area associated with a keyboard and delete /replace when a key is pressed, so I want to start with “clean” code from an example in the simulator to see what’s up.
I tried the link again some time after posting, and it was working - assumed you had fixed it
One of the issues I was trying to narrow down was highlighting of selected text in a textarea in v8.0.1. I wasn’t seeing the highlighting style applied on highlighted text in a textarea. It didn’t work when I applied the style to the textarea:
The v8 textarea documentation says the textarea has a part LV_PART_SELECTED for the style of the highlighted text, so its either a) a code bug, b) a documention bug, or c) I’m doing something wrong
One other thing related to the keyboard - I saw a post about repeated characters from a keyboard appearing in the associated text area in v8, and an offered solution was debouncing the keyboard. However, I had the same issue in v8, in code that worked in v7. I believe it is to do with the default keyboard event handler in conjunction with allowing multiple event handlers in v8. In v7, if you added your own custom event handler, I think that automatically deleted the default event, which you could then later call from the custom event. In v8, the same code I believe will add your custom event handler in conjunction with the default event handler, rather than deleting it as it did in v7, causing this behavior. I’d suggest updating the v8 documentation to be a little more specific on this.
Thanks. That one took me a while, as it wasn’t a ‘breaking’ change and although the documentation did say “remove” it looked very similar to the v7 documentation and didn’t register until later. Your note in the docs should do the trick!