Skip to content

[ADP][BAS] Data entered inside a text area in a single page wizard just right before pressing the Finish button is not included in the final answers object. #920

Description

@avasilev-sap

Steps to reproduce:

  1. Open an Adaptation project and from the command palette select action: Adaptation project: Add SAPUI5 Component Usages.
  2. Fill the required fields in the form.
  3. Enter as a last step some valid key/value pair, e.g. "x": "y", inside the Component settings or Component data text areas.
  4. While the text area is still focused press the Finish button.
    As a result the key/value pair is never populated inside the changes file:
Image

Expected result is to have the key/value pair populated inside the changes file:

{
 "content": {
    "componentUsages": {
      "myComponentId": {
        "name": "MyComponent",
        "lazy": false,
        "settings": {
         "x": "y"
         },
        "componentData": {}
      }
    }
  }
}

Workaround

If we move focus away from the text area after filling it in and then press the Finish button, the key/value pair is populated.

Root-cause analysis

It seems the problem is with the inquirer-gui. The component representing a prompt with type: editor(text area) is QuestionEditor.vue. The QuestionEditor uses vscode-textarea internally, which detects changes in the text content when the text area losses focus (blur or commit events). When we press the Finish button the text area will loose focus and the answers should be updated but this does not happen because the QuestionEditor component adds a debounce in the change handler which gets triggered after the occurrence of the press Finish button event, therefore the answerChanged event gets fired too late and the yeoman generator could not see the changes made in the text area.

This behavior does not apply for text inputs, for a prompt with type: input we have QuestionInput > vscode-textfield. The vscode-textfield fires change event when a new character is entered.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions