Skip to content

Props incorrectly documented for FocalPointPicker #16056

@dsifford

Description

@dsifford

Describe the bug
The docs for components/focal-point-picker state that dimensions is both a property, and required.

It appears that that prop was replaced with an internal function to get the dimensions from the DOM itself.

This should probably be removed to avoid confusion.

The relevant portion of the outdated docs:

### `dimensions`
- Type: `Object`
- Required: Yes
- Description: An object describing the height and width of the image. Requires two paramaters: `height`, `width`.

The relevant portion of the code:

const dimensions = {
width: this.imageRef.current.clientWidth,
height: this.imageRef.current.clientHeight,
};
const pickerDimensions = this.pickerDimensions();
const widthRatio = pickerDimensions.width / dimensions.width;
const heightRatio = pickerDimensions.height / dimensions.height;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions