pydata-sphinx-theme
pydata-sphinx-theme copied to clipboard
ENH: Double click on function parameter selects parameter type as well
When I want to copy a name of a function parameter I typically double-click it to select. Normally that would select the entire parameter and I can now copy and paste it elsewhere.
Here however there seems to be a css or js setting that causes the double click to select the parameter type as well. When I copy it the name of parameter is concatenated to type string without space in between. E.g. double clicking and copy-pasting parameter data
from here will result in a string datastructured
. Ideally it would result only in data
.
Tested on Chrome 89 and Firefox 87, Ubuntu 20.04.
After re-reading this I realize it sounds horribly nitpicky and I apologize. I only bring it up because it might be a common ergonomic issue. Disregard if this makes no sense.
I confirm this behavior (both desktop double-click and on mobile with long-press), and would personally consider it bug-ish.
I tried to have a look at this one and I cannot explain what's happening.
if you look in the instector to what's happening you have the following html:
<dt>
<strong>data</strong>
<span class="classifier">structured ndarray, sequence of tuples or dicts, or DataFrame</span>
</dt>
the ":" is added with css using:
.classifier:before {
font-style: normal;
margin: 0 0.5em;
content: ":";
display: inline-block;
}
So I completely disabled the ":" and this is what I get:
which explains why they are both selected together. The question now is why are this 2 element not living in the same tag so close.
I tried to reproduce it in a codepen and it doesn't behave the same.
I dared to ask on SO and I get an answer (https://stackoverflow.com/questions/73518486/cannot-select-tag-individually-when-double-click), It is effectively a bug, a bug as simple to solve as "add a space between strong
and span
.
this HTML is autogenerated, what is the extension you are using ? so that I can send a message to the appropriate repository
Thanks for looking into this @12rambau!
By extension you mean Sphinx extension? I'm not really familiar with Pandas docs, but I suppose you can check here. I am seeing similar behaviour in Arrow docs, e.g. here.
perfect my guess is that it's coming from numpydoc