Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Make the 'optional' label unselectable #970

Merged
merged 1 commit into from
Jun 26, 2021

Conversation

bruun
Copy link
Contributor

@bruun bruun commented May 21, 2021

This seems to affect only some browsers (happens in Chrome, not in Firefox). When you double click a parameter name that is optional, the browser also selects the word 'optional'. This is pretty annoying when you want to double click and copy a property name, as the actually copied value becomes "propertyNameoptional".

Assuming that no one actually needs to select the text inside the optional label, I figured this was the simplest solution to the problem. Open to other solutions.

This seems to affect only some browsers (happens in Chrome, not in Firefox). When you double click a parameter name that is optional, the browser also selects the word 'optional'. This is pretty annoying when you want to double click and copy a property name, as the actually copied value becomes "propertyNameoptional".

Assuming that no one actually needs to select the text inside the optional label, I figured this was the simplest solution to the problem. Open to other solutions.
@bruun
Copy link
Contributor Author

bruun commented May 21, 2021

On a related note, there's always a space appended before the <span> that contains the optional label, which would also be nice to get rid of unless there's a good reason to keep it? This space also becomes a part of the copied text:

image

Copy link
Contributor

@NicolasCARPi NicolasCARPi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@NicolasCARPi NicolasCARPi merged commit 08e474b into apidoc:dev Jun 26, 2021
@NicolasCARPi
Copy link
Contributor

Thank you, this seems like a reasonable solution to the issue.

As for the space, I removed it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants