See Sanity in action 👀 Join us for a live product demo + Q&A →

Issue with custom input falling back to plain text in code

6 replies
Last updated: Feb 1, 2023
Anyone experience a custom input falling back to just pain text, but not all the time
Jan 31, 2023, 8:24 PM
No! Sounds very strange! What does your code look like?
Jan 31, 2023, 9:11 PM
Like a regular select input, but it’s supposed to be a custom input. Exact same code works on one document, but not another
Feb 1, 2023, 1:17 PM
{
  title: 'Title Alignment',
  name: 'titleAlignment',
  type: 'string',
  initialValue: 'bottom',
  component: {
    input: OptionVisualSelector,
  },
  options: {
    list: [
      {title: 'Top', value: 'top', component: MdVerticalAlignTop},
      {title: 'Middle', value: 'middle', component: MdInsertInvitation},
      {title: 'Bottom', value: 'bottom', component: MdVerticalAlignBottom},
    ],
  },
  validation: (Rule: any) => Rule.required(),
}
It’s basically an icon button display of what would be a dropdown or radio input.
Feb 1, 2023, 1:21 PM
v3
Feb 1, 2023, 1:21 PM
Of course now I see
component
and now
components
🤦‍♂️ Not sure how I copy and paste failed that. #illSeeMyselfOut
Feb 1, 2023, 1:37 PM
Glad you got it sorted!
Feb 1, 2023, 4:12 PM

Sanity.io – build remarkable experiences at scale

Sanity is a customizable solution that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.