Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## [Unreleased]

### Fixed
* Fix tooltip not being interactive: moving the mouse from a code token into its tooltip now keeps the tooltip open, allowing users to select and copy the tooltip text. [#949](https://github.com/fsprojects/FSharp.Formatting/issues/949)
* Add regression test confirming that types whose name matches their enclosing namespace are correctly included in generated API docs. [#944](https://github.com/fsprojects/FSharp.Formatting/issues/944)
* Fix crash (`failwith "tbd - IndirectImage"`) when `Markdown.ToMd` is called on a document containing reference-style images with bracket syntax. The indirect image is now serialised as `![alt](url)` when the reference is resolved, or in bracket notation when it is not. [#1094](https://github.com/fsprojects/FSharp.Formatting/pull/1094)
* Fix `Markdown.ToMd` serialising italic spans with asterisks incorrectly as bold spans. [#1102](https://github.com/fsprojects/FSharp.Formatting/pull/1102)
Expand Down
2 changes: 2 additions & 0 deletions docs/content/fsdocs-default.css
Original file line number Diff line number Diff line change
Expand Up @@ -1012,6 +1012,8 @@ div.fsdocs-tip:popover-open {
position: fixed;
inset: unset;
animation: fsdocs-tip-fade-in 120ms ease-out;
cursor: text;
user-select: text;
}

[data-fsdocs-tip] {
Expand Down
18 changes: 17 additions & 1 deletion docs/content/fsdocs-tips.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,26 @@ document.addEventListener('mouseout', function (evt) {
// Only hide when the mouse has left the trigger element entirely
if (target.contains(evt.relatedTarget)) return;
const name = target.dataset.fsdocsTip;
const unique = parseInt(target.dataset.fsdocsTipUnique, 10);
// Don't hide if the mouse is moving into the tooltip itself (user wants to select/copy text)
const el = document.getElementById(name);
if (el && el.contains(evt.relatedTarget)) return;
hideTip(name);
});

// Hide the tooltip when the mouse leaves the tooltip element itself
document.addEventListener('mouseout', function (evt) {
const tip = evt.target.closest('.fsdocs-tip[popover]');
if (!tip) return;
// Stay open while the mouse remains inside the tooltip
if (tip.contains(evt.relatedTarget)) return;
// Stay open if the mouse returns to the trigger element
const trigger = document.querySelector(`[data-fsdocs-tip="${tip.id}"]`);
if (trigger && trigger.contains(evt.relatedTarget)) return;
try { tip.hidePopover(); } catch (_) { }
currentTip = null;
currentTipElement = null;
});

function Clipboard_CopyTo(value) {
if (navigator.clipboard) {
navigator.clipboard.writeText(value);
Expand Down