Inquirer.js: Setting BottomBar message in validate causes duplicated line

Created on 1 Jun 2016  路  2Comments  路  Source: SBoudrias/Inquirer.js

When I set a "pending" message for the bottom bar during an input validation, it will duplicate the line/answer when the validation completes. Is this expected behavior? See the example below to reproduce (running this in an empty project).

out

var inquirer = require('inquirer')

var ui = new inquirer.ui.BottomBar()

inquirer.prompt([{
  type: 'input',
  name: 'test',
  message: 'Test Input:',
  validate: function () {
    ui.updateBottomBar('Waiting...')

    var done = this.async()
    setTimeout(function() {
       done(null, true)
    }, 2000)
  },
}]).then(function (answers) {
  console.log(answers)
})

Most helpful comment

Confirmed, this line alone will cause duplicated rows:

const ui = new inquirer.ui.BottomBar()

repeated_lines

When I remove it, there's no duplication, as intended.

All 2 comments

I am facing the same issue. When I add a buttomBar to a list, then pressing arrow button duplicates the first two lines (including the header text).
``Image of the Bug

Confirmed, this line alone will cause duplicated rows:

const ui = new inquirer.ui.BottomBar()

repeated_lines

When I remove it, there's no duplication, as intended.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lvjiaxuan picture lvjiaxuan  路  6Comments

apierzch picture apierzch  路  4Comments

dantasfiles picture dantasfiles  路  3Comments

aydn picture aydn  路  5Comments

aguerrieri picture aguerrieri  路  6Comments