Skip to content

Commit

Permalink
fix(widgets) widget id was required, should be optional (#9026)
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Gervang <chris@gervang.com>
  • Loading branch information
chrisgervang committed Jul 14, 2024
1 parent 9e27270 commit 95930c4
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions docs/api-reference/widgets/compass-widget.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ This widget visualizes bearing and pitch. Click it once to reset bearing to 0, c

## Props

#### `id` (string) {#id}
#### `id` (string, optional) {#id}

Default: `'fullscreen'`
Default: `'compass'`

Unique identifier of the widget.
The `id` must be unique among all your widgets at a given time. It's recommended to set `id` explicitly. The `id` is used to match widgets between updates, ensuring deck.gl can distinguish between them. A default `id` is assigned based on widget type, so if you have multiple widgets of the same type (e.g., two `compass` widgets), you need to provide a custom `id` for at least one.

#### `viewId` (string, optional) {#viewid}

Expand Down
4 changes: 2 additions & 2 deletions docs/api-reference/widgets/fullscreen-widget.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ This widget enlarges deck.gl to fill the full screen. Click the widget to enter

## Props

#### `id` (string) {#id}
#### `id` (string, optional) {#id}

Default: `'fullscreen'`

Unique identifier of the widget.
The `id` must be unique among all your widgets at a given time. It's recommended to set `id` explicitly. The `id` is used to match widgets between updates, ensuring deck.gl can distinguish between them. A default `id` is assigned based on widget type, so if you have multiple widgets of the same type (e.g., two `compass` widgets), you need to provide a custom `id` for at least one.

#### `placement` (string, optional) {#placement}

Expand Down
4 changes: 2 additions & 2 deletions docs/api-reference/widgets/zoom-widget.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ This widget controls the zoom level of a deck.gl view. Click '+' to zoom in by 1

## Props

#### `id` (string) {#id}
#### `id` (string, optional) {#id}

Default: `'zoom'`

Unique identifier of the widget.
The `id` must be unique among all your widgets at a given time. It's recommended to set `id` explicitly. The `id` is used to match widgets between updates, ensuring deck.gl can distinguish between them. A default `id` is assigned based on widget type, so if you have multiple widgets of the same type (e.g., two `compass` widgets), you need to provide a custom `id` for at least one.

#### `viewId` (string, optional) {#viewid}

Expand Down
2 changes: 1 addition & 1 deletion modules/widgets/src/compass-widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type {Deck, Viewport, Widget, WidgetPlacement} from '@deck.gl/core';
import {render} from 'preact';

interface CompassWidgetProps {
id: string;
id?: string;
placement?: WidgetPlacement;
/**
* View to attach to and interact with. Required when using multiple views.
Expand Down
2 changes: 1 addition & 1 deletion modules/widgets/src/fullscreen-widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {render} from 'preact';
import {IconButton} from './components';

interface FullscreenWidgetProps {
id: string;
id?: string;
placement?: WidgetPlacement;
/**
* A [compatible DOM element](https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullScreen#Compatible_elements) which should be made full screen.
Expand Down
2 changes: 1 addition & 1 deletion modules/widgets/src/zoom-widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {render} from 'preact';
import {ButtonGroup, GroupedIconButton} from './components';

interface ZoomWidgetProps {
id: string;
id?: string;
placement?: WidgetPlacement;
/**
* View to attach to and interact with. Required when using multiple views.
Expand Down

0 comments on commit 95930c4

Please sign in to comment.