Simple way to get copy working on my own pane item?


#1

I just did a quick and dirty log panel for an external process. I just used ScrollView and an ul with each log row going into a li. I noticed that copy didn’t work for this and realize that copy functionality maybe is a bit more involved than normal copy from a web page, like:

But is there any simple way to get copy working for a use case like mine?


#2

Do a search here for native-key-bindings. It is generally a key to getting this kind of thing to work.


#3

@leedohm Thanks for the tip! In my case, adding native-key-bindings doesn’t seem to work though. It’s a very simple html, just a div with ul in it:

class LogView extends ScrollView

  @content: (params) ->
    @div class: 'ensime-log-view scroll-view native-key-bindings', =>
      #@h1 class: 'panel-heading', params.title
      @ul class: 'list-group padded native-key-bindings', outlet: "list"
  initialize: (params) ->
    @title = params.title

  addRow: (row) ->
    @list.append "<li class='native-key-bindings'>#{row}</li>"

As you can see, I tried native-key-bindings on each element, but still no.


#4

There’s something about tab order too, if I recall correctly.


#5

@leedohm Thanks! Found Backspace isn’t working in regular text fields :( and tried putting taborder=’-1’ on both the div and ul to no avail.


#6

It’s not “taborder”, it’s tabindex. Just in case that typo was in your code and not in the posting…

(Edit: had a typo in this posting itself – “tabindex” without a dash seems to be the right spelling.)


#7

@kgrossjo, Heh, thanks! Had to actually double check, but unfortunately was only in posting I wrote taborder.

However, need to confess that I had erased the native-key-bindings class when I tried tabindex. Now with them both, it works! Thanks everyone!