Elius94 / console-gui-tools

A simple library to draw option menu or other popup inputs and layout on Node.js console.
MIT License
106 stars 17 forks source link

[Bug]: InputPopup can handle strings #79

Closed kyg0h closed 7 months ago

kyg0h commented 7 months ago

What happened?

Trying to use the InputPopup to get a string returns NaN. Entering a number logs the correct output. I have tried converting that str variable to string but is looks like the function only returns numbers.

What should have happened?

A string as an output

Code

let input = new InputPopup({ id: "popupTypeStr", title: "Pega el enlace", value: "", numeric:false, }) .show() .on("confirm",(str) => { GUI.warn(str) });

Library Version

3.2.2

Node Version

20.8.0

What operating system are you using?

Ubuntu

Terminal

gnome-terminal

Interest to fix the bug

kyg0h commented 7 months ago

I think I found it, line 521 of InputPupup.ts casts the value to a number.