Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Events do not trigger on list select #10

Open
GavinRay97 opened this issue Jul 6, 2018 · 3 comments
Open

Events do not trigger on list select #10

GavinRay97 opened this issue Jul 6, 2018 · 3 comments

Comments

@GavinRay97
Copy link

GavinRay97 commented Jul 6, 2018

@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.
@lyonlai
Copy link
Owner

lyonlai commented Aug 22, 2018

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

@lyonlai
Copy link
Owner

lyonlai commented Aug 23, 2018

@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
Copy link
Owner

lyonlai commented Aug 23, 2018

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%"/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants