microsoft / design-to-code

A system of development tools, and utilities used à la carte or as a suite to build enterprise-grade websites and applications.
MIT License
24 stars 6 forks source link

[Feature]: Scroll the Monaco Editor to an item when the navigation update message is sent #53

Closed janechu closed 3 years ago

janechu commented 3 years ago

What package(s) should this feature be added to?

@microsoft/fast-tooling

Summary

When the MessageSystem sends a navigation update, the relevant HTML element should scroll into view. It should come as close to the top of the scrollable area as possible.

To ensure that the Monaco Editor can scroll into view and prompt other UI to scroll items into view, the following will have to be possible:

The Monaco Editor (ICodeEditor returned after using monaco.editor.create) currently supports:

Proposal

Currently the Monaco Editor is setup by the implementer and the MonacoAdapter service is used only for MessageSystem events. This should extend to navigation level events, so just as there can be a MonacoAdapterAction for setting the Monaco Editor value, so to must there be an action for setting and getting navigation updates.