When using a!paragraphField, we have refreshAfter: set to "KEYPRESS".

Certified Senior Developer
When using a!paragraphField, we have refreshAfter: set to "KEYPRESS". We want to limit the character count in the paragraph field, which works by truncating in the saveInto, and we can provide a live character count in the instructions below, however the user may still enter additional characters into the paragraph, and they don't get cut off until the field loses focus (they tab or click outside of it). Is there any way to immediately reflect the truncated value in the paragraph field while they are typing?

OriginalPostID-142471

OriginalPostID-142471

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    Whoops, you're right - it seems that no matter what trickery we do within the saveInto{}, the text / paragraph box won't reflect the changes until focus is lost. This smaller code snippet probably reproduces the issue concisely:

    a!textField(
    label: "test",
    value: ri!text,
    refreshAfter: "KEYPRESS",
    disabled: len(ri!text) > 5,
    saveInto: {
    a!save(
    ri!text,
    left(save!value, 5)
    )
    }
    )
Reply
  • 0
    Certified Lead Developer
    Whoops, you're right - it seems that no matter what trickery we do within the saveInto{}, the text / paragraph box won't reflect the changes until focus is lost. This smaller code snippet probably reproduces the issue concisely:

    a!textField(
    label: "test",
    value: ri!text,
    refreshAfter: "KEYPRESS",
    disabled: len(ri!text) > 5,
    saveInto: {
    a!save(
    ri!text,
    left(save!value, 5)
    )
    }
    )
Children
No Data