Skip to content

Commit

Permalink
workaround for AdaptiveCard bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Wolf committed Feb 7, 2020
1 parent 2f2b77e commit 7f6f97b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/hadron.js
Original file line number Diff line number Diff line change
Expand Up @@ -1720,17 +1720,18 @@ class Hadron {

adaptiveCard.onExecuteAction = (action) => {
console.log("Triggered submit action from adaptive card: ", action)
if (action.constructor.name == 'SubmitAction') {
//tried with class name first but some times it gets 'e' as name
if (action.getJsonTypeName() == 'Action.Submit') {
if (action.data.hasOwnProperty('imBack')) { //does this work?
this.userSaid(action.data.imBack)
}
if (action.data.hasOwnProperty('value')) {
} else if (action.data.hasOwnProperty('value')) {
this.userSaid(action.data.value)
}
}
if (action.constructor.name == 'OpenUrlAction') {
if (action.getJsonTypeName() == 'Action.OpenUrl') {
var win = window.open(action.url, '_blank')
}

this.inputText.focus(); // clicking on actions takes focus out of input text field
}

Expand Down

0 comments on commit 7f6f97b

Please sign in to comment.