Inquirer.js
Inquirer.js copied to clipboard
Using transformer and moving the caret cursor
Hi there :)
I'm using the transformer
function to visually append hinted data such as:
transformer: (input, answer) => {
return `${a}.mydomain.com`;
}
works as expected, but how could I play with the caret cursor so it's positioned where the user is typing:
Full example:
var inquirer = require('inquirer');
inquirer.prompt({
name: 'hostname',
type: 'input',
message: 'hostname:',
transformer: function(a,b) {
return `${a}.mydomain.com`
}
});
Is it possible?