Instawork / hyperview

Server-driven mobile apps with React Native

Home Page:https://hyperview.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Trigger `change` is not working with action `dispatch-event` if there is no `delay` attribute

abdelav opened this issue · comments

commented

Using the a behavior change trigger to dispatch an event on <Text-field> element is not working if the behavior doesn't have the delay attribute.

Not working example:

<text-field name="phone" placeholder="Your phone number">
  <behavior trigger="change" action="dispatch-event" event-name="some-event" />
</text-field>

working example:

<text-field name="phone" placeholder="Your phone number">
  <behavior delay="0" trigger="change" action="dispatch-event" event-name="some-event" />
</text-field>

Let me test this in the demo app, will report back.

@abdelav did you notice this for other behavior actions, or only dispatch-event?

commented

I just tested with dispatch-event so far, but let me test with other actions an I will report back.

I just tried it in the demo app and couldn't reproduce with dispatch-event: https://github.com/Instawork/hyperview/compare/adam/test-event1?expand=1

Simulator.Screen.Recording.-.iPhone.14.-.2023-05-03.at.16.41.14.mp4
commented

ok, this is probably an internal issue then?

Perhaps, message me privately with the issue so we can check.