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

De-couple focal-point selection from crop-selection (image hotspot option) #5985

Open
ryami333 opened this issue Mar 12, 2024 · 0 comments
Open

Comments

@ryami333
Copy link

We have a use-case where the crop of an image is defined by the front-end, but we want to permit editors to define the focal-point of the image. Unfortunately, the hotspot feature is catch-all that enables both crop-selection and focal-point selection, which has been confusing our editors. We've been telling them just to ignore the cropping square, but it confuses them because image previews in Sanity itself use this crop selection.

This could be configured in a backward compatible manner by permitting boolean values and discrete options with a nested object, eg:

defineField(
    {
      name: "myImage",
      type: "image",
      title: "My Image",
      options: {
        // Configuration option #1: boolean
        hotspot: true,
        // Configuration option #2: discrete options
        hotspot: {
          crop: true,
          focalPoint: true,
        },
      },
    },
);
@ryami333 ryami333 changed the title De-couple hotspot selection from crop selection De-couple focal-point selection from crop-selection (image hotspot option) Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant