Hoppa till huvudinnehållet

Capture key press character in workflow form?

Kommentarer

2 kommentarer

  • Gareth Evans

    Hey Marc Rempel long time no talk.

    From what I know, there isn't a way to capture non-printable keypresses (arrows, enter, etc) in Studio Workflow forms. The event system we created wasn't intended to cover this use case, so in this scenario you'd need to do something custom.

    If you're running in a Studio Web context, you could achieve this by using a React Hook called useKeyPress. There are developer documentation for how to Reference Third Party Libraries such as this react hook. This would get you an event that fires on any key press that you could then do something on.

    I'm curious, what's your specific use case that you're looking to handle? I imagine there's some sort of data entry going on, like a barcode scanner or something?

    0
  • Marc Rempel

    Hey Gareth,

    You are everwhere :).

    Our use case is that we have a box for users to enter their lat/long to run a report. It was requested that one could run the report when you hit enter vs having to click the button. The form change event does fire with the enter key and we can wire that to run the report, but the change event also fires when a user might click outside the input box on the map or anywhere else and not mean to submit the input yet for the report. So we are looking for any other way to narrow it down to just the enter button knowing that input in html have keypress events.

    0

Du måste logga in om du vill lämna en kommentar.