mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Improve focus and keyboard shortcuts in modals.
Summary: - Factor out focusing logic from Clipboard to FocusLayer. - Generalize FocusLayer to support adding a temporary layer while a modal is open. - Stop Mousetrap shortcuts while a modal is open. - Refactor how Mousetrap's custom stopCallback is implemented to avoid needing to bundle knockout for mousetrap. Test Plan: Added a test that Enter in a UserManager doesn't open a cell editor from underneath the modal. Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D2626
This commit is contained in:
@@ -49,6 +49,14 @@ export class RefCountMap<Key, Value> implements IDisposable {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the value for the key, if one is set, or undefined otherwise, without touching
|
||||
* reference counts.
|
||||
*/
|
||||
public get(key: Key): Value|undefined {
|
||||
return this._map.get(key)?.value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Purge a key by immediately removing it from the map. Disposing the remaining IRefCountSub
|
||||
* values will be no-ops.
|
||||
|
||||
Reference in New Issue
Block a user