blessed-vue icon indicating copy to clipboard operation
blessed-vue copied to clipboard

Events do not trigger on list select

Open GavinRay97 opened this issue 7 years ago • 3 comments

@select, @action do not work with list.

    <list
      :items="appList.map(x => `${x.name} - ${x.buildpack_provided_description}`)"
      :keys="true"
      :mouse="true"
      @select="changeCurrentApp"
      @action="changeCurrentApp"  
      ref="appListElement"
      left="75%"
      width="25%"
      :style="{
        selected: {
          bg: 'cyan',
          fg: 'white',
          border: {
            fg: 'green',
          }
        }
      }" />

changeCurrentApp does not fire with key up/down or a click on the list item, even though the selected item in the list changes.

From http://blessedjs.org/widgets/lists/list.html

EVENTS:
Inherits all from Box.
select - Received when an item is selected.
cancel - List was canceled (when esc is pressed with the keys option).
action - Either a select or a cancel event was received.

GavinRay97 avatar Jul 06 '18 17:07 GavinRay97

@GavinRay97 sorry for the late reply. I'll take a look soon.

lyonlai avatar Aug 22 '18 12:08 lyonlai

@GavinRay97 I've got this line as following works. Might need to look into why the other one doesn't

v-on:select="select"

lyonlai avatar Aug 23 '18 13:08 lyonlai

hmm. the @ syntax works for me as well....

here the example

<list ref='list' @select="select" :blessed='true' :items="list" align="left" valign="top" :border="{ type: 'line' }" :interactive="true" :mouse="true" :keys="true" :style="listStyle" top="center" left="center" width="50%" height="50%"/>

lyonlai avatar Aug 23 '18 13:08 lyonlai