Forum Stats

  • 3,780,689 Users
  • 2,254,426 Discussions


user-select on oj-list-view

user10755793 Member Posts: 2
edited Feb 12, 2021 11:00AM in Oracle JET

user-select is disabled by default on oj-list-view . How can I turn this ON so that I can copy text from the oj-list-view



  • Using the ListView Cookbook demo as an example, you can simply add the CSS style on to the span for the text that you want to allow to be selected.

      <span class="oj-typography-body-md oj-text-color-primary"><oj-bind-text value="[[]]"></oj-bind-text></span>
      <oj-avatar slot="leading" size="xs" src="[[]]"></oj-avatar> 
      <span style="user-select:text" slot="secondary" class="oj-typography-body-sm oj-text-color-secondary"><oj-bind-text value="[[]]"></oj-bind-text></span>

        In the code above, I have made the second span (the employee title) selectable. Note that this is not always a great thing to enable. If you want any kind of Drag and Drop, or swipe behavior on your list items, this will interfere with that. It will also still select the item if you have selection enabled on the listview.