最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

plugins - WordPress Gutenberg How to make TextControl Required?

programmeradmin3浏览0评论

I want to make this field required. Can anyone suggest how to do it?

<TextControl
    tagName="p"
    label="url"
    placeholder="http://"
    focus = {focus}
    className="full-width "
    value={ props.attributes.url }
    onChange={ onChangeurl }
    keepPlaceholderOnFocus= {true}
/>

I want to make this field required. Can anyone suggest how to do it?

<TextControl
    tagName="p"
    label="url"
    placeholder="http://"
    focus = {focus}
    className="full-width "
    value={ props.attributes.url }
    onChange={ onChangeurl }
    keepPlaceholderOnFocus= {true}
/>
Share Improve this question edited Aug 11, 2020 at 7:59 cjbj 15k16 gold badges42 silver badges89 bronze badges asked Aug 10, 2020 at 21:44 Mangesh YadavMangesh Yadav 431 silver badge7 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

This could possibly done using lockPostSaving

Some code example ➡ https://github/WordPress/gutenberg/pull/16713

发布评论

评论列表(0)

  1. 暂无评论