mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Draft cells
Summary: Cells will remember their previous state when user pressed the escape key. Grist will offer a way to continue with the draft, by showing notification and a tooltip above the editor. Test Plan: Browser tests were created Reviewers: dsagal Reviewed By: dsagal Differential Revision: https://phab.getgrist.com/D2822
This commit is contained in:
@@ -56,12 +56,16 @@ const openTooltips = new Map<string, ITooltipControl>();
|
||||
* Show tipContent briefly (2s by default), in a tooltip next to refElem (on top of it, by default).
|
||||
* See also ITipOptions.
|
||||
*/
|
||||
export function showTransientTooltip(refElem: Element, tipContent: DomContents, options: ITransientTipOptions = {}) {
|
||||
const ctl = showTooltip(refElem, () => tipContent, options);
|
||||
export function showTransientTooltip(
|
||||
refElem: Element,
|
||||
tipContent: DomContents | ITooltipContentFunc,
|
||||
options: ITransientTipOptions = {}) {
|
||||
const ctl = showTooltip(refElem, typeof tipContent == 'function' ? tipContent : () => tipContent, options);
|
||||
const origClose = ctl.close;
|
||||
ctl.close = () => { clearTimeout(timer); origClose(); };
|
||||
|
||||
const timer = setTimeout(ctl.close, options.timeoutMs || 2000);
|
||||
return ctl;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user