Merge pull request #390 from JCDraffin/feature-readonly

Feature: Readonly support to editable text widgets
This commit is contained in:
Adam D. Ruppe 2023-05-23 09:50:57 -04:00 committed by GitHub
commit fb7ad07e6b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12214,6 +12214,8 @@ class TextDisplayHelper : Widget {
}); });
this.addEventListener((scope CharEvent ce) { this.addEventListener((scope CharEvent ce) {
if(readonly)
return;
if(ce.character < 32 && ce.character != '\t' && ce.character != '\n' && ce.character != '\b') if(ce.character < 32 && ce.character != '\t' && ce.character != '\n' && ce.character != '\b')
return; // skip the ctrl+x characters we don't care about as plain text return; // skip the ctrl+x characters we don't care about as plain text