Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(widgets) widget id was required, should be optional #9026

Merged
merged 1 commit into from
Jul 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading