[squeak-dev] textEdited not invoked for punctuation and backspace

Jakob Reschke forums.jakob at resfarm.de
Sun Oct 14 18:58:16 UTC 2018


Hello,

I noticed that the editTextSelector is not sent to the model of a
TextMorphForEditView (Morphic's PluggableInputField) when you press
backspace or punctuation.

The cause is obvious in TextMorphForEditView>>keyStroke:

"Make a cheap check and guess editing. (Alternative would be to copy the
old contents and then compare them against the new ones. Maybe add a better
hook in the TextEditor."
(self readOnly not and: [evt keyCharacter isAlphaNumeric or: [evt
keyCharacter isSeparator]])
ifTrue: [view textEdited: self contents].

Is there a rationale behind only including alphanumeric and separator
characters, but not punctuation or the obvious editing stroke of pressing
backspace? Should they rather be included even if it means some more checks
of the Character?

Also note that there is no #isPunctuation (or similar) in Character and
#isSpecial does not include the full stop.

I wanted to synchronize the text of one input field with that of another
(with a transformation in between) in case the latter of the two was not
manually modified by the user. Especially the lack of backspace propagation
impacts the user experience in this case.

Kind regards,
Jakob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20181014/4945fe25/attachment.html>


More information about the Squeak-dev mailing list