Skip to content

Commit 1d5edfd

Browse files
wolfibDevtools-frontend LUCI CQ
authored andcommitted
Fix typo in UI Engineering docs
Bug: none Change-Id: I119dd8d93258bb389ed4ba006c2a3fc64fe150d2 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6850143 Reviewed-by: Danil Somsikov <[email protected]> Commit-Queue: Danil Somsikov <[email protected]> Auto-Submit: Wolfgang Beyer <[email protected]>
1 parent b1a865e commit 1d5edfd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/ui_engineering.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ To embed another presenter (`UI.Widget`) in the lit-html template, use `<devtool
4444

4545
This will instantiate a `Widget` class with the web component as its `element` and, optionally, will set the properties provided in the second parameter. The widget won’t be re-instantiated on the subsequent template renders, but the properties would be updated. For this to work, the widget needs to accept `HTMLElement` as a sole constructor parameter and properties need to be public members or setters.
4646

47-
For backwards compatibility, the first argument to `widgetConfig` can also be a factory function: `<devtools-widget .widgetConfig=${widgetConfig(element => new MyWidget(foo, bar, element))}>`. Similar to the class constructor version, `element` is the actual `<devtools-widget>` so the following two invocations of `widgetConfig` are equivalent: `widgetConfig(MyWidget)` and `widgetConfig(element = new MyWidget(element))`.
47+
For backwards compatibility, the first argument to `widgetConfig` can also be a factory function: `<devtools-widget .widgetConfig=${widgetConfig(element => new MyWidget(foo, bar, element))}>`. Similar to the class constructor version, `element` is the actual `<devtools-widget>` so the following two invocations of `widgetConfig` are equivalent: `widgetConfig(MyWidget)` and `widgetConfig(element => new MyWidget(element))`.
4848

4949
## Styling
5050
To prevent style conflicts in widgets without relying on shadow DOM, we use the CSS [`@scope`](https://developer.mozilla.org/en-US/docs/Web/CSS/@scope) at-rule for style encapsulation. This ensures that styles defined for a widget do not leak out and affect other components.

0 commit comments

Comments
 (0)