This was an interesting scenario that I came across with. PDF.JS by default can let you select text and copy them to the clipboard. However, since my requirement had us do with creating annotations and since it is messy to mess around the DIV layers of the PDF.JS pages, we had to create a separate Canvas element to draw out annotations in.
Now, the problem is that since there is an extra Canvas layer on top of the existing Canvas layer of PDF.JS where they draw their images if the PDF contains pictures, selecting text is not possible.
However, through a CSS attribute it is possible to let mouse clicks pass through the Canvas element using the pointer-event attribute. The values for these are auto for enabled and none for disabled.
I bet you get confused why the ListView object does not capture click events at times. Ever thought that maybe the components within each ListView entry contain components that accept input events?
Take for example EditText or a Spinner? If this was a regular TextView, then there will definitely be no problem when it comes to capturing click events in the OnItemClickListener or OnItemLongClickListener().
What you can do to fix this is to set your EditText component to disable events so these such events will be relegated to the ListView.
You can do this by setting android:focusable=”false” and android:focusableInTouchMode=”false” in the XML layout file. Try it and check it out.
You will see that by setting these attributes to false in your EditText, your ListView object can then capture click events.