Search code examples
javascriptpebble-watchpebble-sdkpebble-js

Pebble.JS card when "action" is set - "scrollable" fails


I am trying to create a card that would have action on clicking "select" button and still have scrollable text, something like:

var card = new UI.Card({
  title: 'Title',
  body: 'long text goes here...',
  action: {
    select: 'images/refresh.png',
    backgroundColor: 'white'
  },
  scrollable: true
});

card.on('click', function(e) {
  if (e.button == 'select') {
      //some code
  } 
});

if executed like this - icon in action bar is visible and "click" event runs, but "scrollable: true" no longer has effect. If I comment "action" property - "click" event still runs and this time "scrollable: true" is working, but of course no icon is displayed. Is it a bug or is it by design? How can I have best of both worlds - display icon for "select" and keep card scrollable?


Solution

  • Thanks to this question, I've made a commit that will allow you to use the action bar layer and scroll layer at the same time: https://github.com/pebble/pebblejs/commit/04f926f137395a0ebd0faaab8b0722da9aa75a7d.

    I'll update this answer when the commit is merged into CloudPebble.