Page 1 of 1

textChanged is not invoked after cutting text

Posted: Sat Jan 19, 2019 10:27 am
by kaveh1000
Working on Mac with latest Community version of LC. Cutting text via menu or keyboard shortcut does not invoke textChanged handler. (But pasting does.) Please see attached minimal example.

Re: textChanged is not invoked after cutting text

Posted: Sat Jan 19, 2019 11:32 am
by jmburnod
Hi,
Same result fro me (lC indy 9.0.1)
It works with a simple "cut" message sent by a btn

Code: Select all

on mouseup
   cut
end mouseup
I wonder if that is an IDE behavior
What happens in standalone ?

Re: textChanged is not invoked after cutting text

Posted: Sat Jan 19, 2019 11:58 am
by bogs
Tested using ctrl + x on Win7 with Lc 9.0.2, and it doesn't count as a text changed event there, either. It *does* however on 'nix using Lc 6.x, so I'm guessing it is a bug?
Win7Tester [Running] - Oracle VM VirtualBox_004.png
One...
Win7Tester [Running] - Oracle VM VirtualBox_005.png
twooo...
Win7Tester [Running] - Oracle VM VirtualBox_006.png
threeeeee! (Count the smilies)

Re: textChanged is not invoked after cutting text

Posted: Sat Jan 19, 2019 1:03 pm
by richmond62
Hmm . . .
-
TextCH.png

Re: textChanged is not invoked after cutting text

Posted: Sat Jan 19, 2019 1:07 pm
by richmond62
I wonder why this does NOT seem to work:

Code: Select all

if the clipBoardData is not empty then
      put "CRAP"
   end if
when I've CUT some text?

Re: textChanged is not invoked after cutting text

Posted: Sat Jan 19, 2019 5:56 pm
by richmond62
Cut

does not behave in the same way as delete
because delete involves an insertion point in a field
while cut involves selectedText.

Re: textChanged is not invoked after cutting text

Posted: Tue Jan 22, 2019 10:35 am
by kaveh1000
Hi folks

Just an update that I have reported this and it has been confirmed as a regression bug:

https://quality.livecode.com/show_bug.cgi?id=21802

Thanks for your comments on this.

Kaveh

Re: textChanged is not invoked after cutting text

Posted: Tue Jan 22, 2019 12:02 pm
by bogs
Good job on that Kaveh, we got to keep Panos hammer swinging on those bugs Image

Re: textChanged is not invoked after cutting text

Posted: Tue Jan 22, 2019 12:17 pm
by jmburnod
Hi All,
It seems that only concern IDE.
I played with an edit menu created with menu builder and it send a textchanged message on idE or standalone and shortcuts work as expected in standalone (LC 9.0.1 OSX 10.139
textChange001.zip
(1.93 KiB) Downloaded 226 times
Best
Jean-Marc

Re: textChanged is not invoked after cutting text

Posted: Tue Jan 22, 2019 1:19 pm
by bogs
That is good to know Jean-Marc, of course, from our perspective (devs) it is important to work everywhere eh :)

Re: textChanged is not invoked after cutting text

Posted: Wed Feb 06, 2019 1:13 pm
by kaveh1000
Hi Folks

So cutting text will invoked in Standalone but not in IDE due to a bug. Is there any handler I can use in the meantime to detect when text has been cut?

Regards
Kaveh

Re: textChanged is not invoked after cutting text

Posted: Wed Feb 06, 2019 1:21 pm
by bogs
I would suspect you could use the clipboard, since we are talking about cutting/copying operations. One way might be to throw the clipboard contents into a variable, then check if the text in the variable changes.

Re: textChanged is not invoked after cutting text

Posted: Mon Feb 11, 2019 5:07 pm
by jmburnod
Hi All
Textchanged also doesn’t work when I put a letter by script into/after/before a field
Jean-Marc