Like what we’re doing? Star us on GitHub!

Remove "field width" in form builder plugin

Ellie
last month
1

Decided to try implementing the form builder plugin into my website today but am currently kind of stuck on the "field width" field. And I know that sounds stupid and I could just leave it empty but for me the beauty of Payload so far is that I can really tailor it to what I need. I looked through the source code of the plugin and it seems there isn't a built-in way to remove it 😅



My two cents: the field width input should probably not be a default. All the other fields are absolutely essential, but that field is very dependent on the design being implemented in the frontend. I think it would perhaps be better to have an easier way of extending the default fields with field width inputs, but by default I don't think it's a good thing to have.



If that's something that can maybe be agreed on, I would be down to make a PR to the plugin! Otherwise I could suffice with just having the blocks in

https://github.com/payloadcms/plugin-form-builder/blob/main/src/collections/Forms/fields.ts

exported so I can reuse them. Or in the worst case do some copy pasting 🙈

  • jacobsfletch
    Payload Team
    4 weeks ago

    Totally see your point here and I agree that

    width

    is pretty specific to front-end. The problem here is that it's already in the API so we can't remove it at this point. What you

    could

    do here is override that field with

    hidden: true

    so that it never appears in the admin panel. Would that work for you?

Open the post
Continue the discussion in Discord
Can't find what you're looking for?
Get help straight from the Payload team with an Enterprise License.Learn More