microsoft / AdaptiveCards-Mobile

MIT License
8 stars 13 forks source link

Added ValueChangedAction object #138

Closed prpatwa closed 1 month ago

prpatwa commented 1 month ago

Description

A new property ValueChangedAction can come in all the InputElements. That contains 2 properties - type and targetInputIds. targetInputIds is a list of String that contains id of other InputElement in the card. If any InputElement has ValueChangedAction then whenever the value of that InputElement changes it needs to notify all other InputElement defined in targetInputIds array. And all the inputElement in targetId array need to reset their value to the default one.

If ValueChangedAction isn't null, BaseInputHandler adds an InputWatcher. WhenInputWatcher.onInputChange is triggered it fetches all the InputHandler from the renderedAdaptiveCard based on cardId. It check these handlers against the targetInputIds. If input id matches one of the targetInputIds, it triggers resetValue on that InputHandler.

Sample Card

Added ValueChangedAction.json

How Verified

https://github.com/microsoft/AdaptiveCards-Mobile/assets/68814139/26db3290-93a4-4352-a50b-edcf953ae330