cannot select tag individually when double click

Viewed 43

In the pandas documentation (hence in the pydata-sphinx-theme), we are facing an issue with the double click behavior and I thought that maybe an html expert could help us understand what's happening. ref: https://github.com/pydata/pydata-sphinx-theme/issues/388

In this page if I click double click on "data", instead of simply select "data", it selects "datastructured".

looking at the inspector this part of the website html is as follow:

<dt>
    <strong>data</strong>
    <span class="classifier">structured ndarray, sequence of tuples or dicts, or DataFrame</span>
</dt>

the ":" is added with css:

.classifier:before {
font-style: normal;
margin: 0 0.5em;
content: ":";
display: inline-block;
}

If I remove the ":" I realize that there is no space between the 2 words explaining why they are selected together

I tried to reproduce it in a code pen but it never works: https://codepen.io/12rambau/pen/mdXQayr

Can someone have a look at the page and help identify what is causing this weird behaviour ?

1 Answers

As you identified, both of the words are selected when double click on the first word because there is no space between the words in the HTML.

If you inspect the page, right-click the <dt> tag, and select 'Edit as HTML' (in Chrome), you'll see the HTML code is all on one line without a space between data and structured. You can also see this when you view the page source code.

Different formatting has been applied in your CodePen reproduction so that's why the same behaviour isn't being reproduced.

Here's a working reproduction:

.classifier:before {
  font-style: normal;
  margin: 0 0.5em;
  content: ":";
  display: inline-block;
}
<dt><strong>data</strong><span class="classifier">structured ndarray, sequence of tuples or dicts, or DataFrame</span></dt>

You can fix this by reformatting the HTML as you've done in your CodePen example, or adding a space character after or at the end of the <strong> tag.

Related