Page MenuHomePhabricator

Selecting page title in sticky header will include newline characters
Closed, DeclinedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Go to a page on a wiki with the Sticky Header feature enabled (such as this page on fawiki)
  • Scroll down so that the sticky header appears
  • Triple click on the page title and copy the selection
  • Paste the selection into a multiline textarea (e.g. the edit box on another page)

What happens?:
You will see the a newline character is selected before and also after the page title. In the case of ویکی‌پدیا:ترجمه مدیاویکی the selection looks like this:

ویکی‌پدیا:ترجمه مدیاویکی

What should have happened instead?:
Only the page title should be selected, without any newline characters.

Other information (browser name/version, screenshots, etc.):

As a comparison, triple click on a section header, or triple click on the page title when you have fully scrolled back up (i.e. the sticky header is hidden). Both of those will *not* result in selection of newline characters.

Event Timeline

I've looked into this and to be honest I don't know what might cause this issue. It's not limited to any specific language, it happens in all languages and browsers as far as I can tell.

  1. There is no whitespace in the mustache template that generates the sticky header title.
  2. There is no whitespace in the source HTML around that title
  3. There are no pseudo :after/:before elements around the title that would be selected.
  4. Changing the surrounding element from a <div> to an <h1> also doesn't fix the issue.

There is no specification around what triple-clicking text in a browser should do, so given that the title is still selectable using the main header of the page, this bug seems very minor and I don't think we should spend more time investigating this issue.