-
Notifications
You must be signed in to change notification settings - Fork 211
Open
Description
Bug Description
When using LabeledInput with type: 'selectMulti', the toggle button attrs (turnedOn/turnedOff styles) are not applied to the internal SelectListMulti widget.
Root Cause
In LabeledInput.prototype.initSelectMultiInput (LabeledInput.js), the attrs are passed with names like turnedOnBlurAttr:
this.input = new SelectListMulti( {
// ...
turnedOnBlurAttr: this.turnedOnBlurAttr ,
turnedOnFocusAttr: this.turnedOnFocusAttr ,
turnedOffBlurAttr: this.turnedOffBlurAttr ,
turnedOffFocusAttr: this.turnedOffFocusAttr ,
// ...
} ) ;However, SelectListMulti (via BaseMenu) reads these attrs with the button prefix:
// BaseMenu.js lines 104-107
this.buttonTurnedOnBlurAttr = options.buttonTurnedOnBlurAttr || this.defaultOptions.buttonTurnedOnBlurAttr || { bgColor: 'cyan' } ;
this.buttonTurnedOnFocusAttr = options.buttonTurnedOnFocusAttr || this.defaultOptions.buttonTurnedOnFocusAttr || { bgColor: 'brightCyan' , color: 'gray' , bold: true } ;
this.buttonTurnedOffBlurAttr = options.buttonTurnedOffBlurAttr || this.defaultOptions.buttonTurnedOffBlurAttr || { bgColor: 'gray' , dim: true } ;
this.buttonTurnedOffFocusAttr = options.buttonTurnedOffFocusAttr || this.defaultOptions.buttonTurnedOffFocusAttr || { bgColor: 'white' , color: 'black' , bold: true } ;Expected Behavior
Custom toggle attrs passed to LabeledInput should be applied to the dropdown items.
Suggested Fix
In LabeledInput.prototype.initSelectMultiInput, change:
turnedOnBlurAttr: this.turnedOnBlurAttr ,to:
buttonTurnedOnBlurAttr: this.turnedOnBlurAttr ,(and similarly for the other three toggle attrs)
Version
terminal-kit 3.1.2
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels