dogfish
dogfish

Reputation: 21

Multiline placeholder in textarea for safari and firefox

I'm trying to add a placeholder to a textarea in the forms in my reactjs project. The placeholder is multiline and looks like this

      <textarea
        {...this.props}
        ref={textarea => {
          this.textarea = textarea;
        }}
        placeholder={'Address Line1\nAddress Line\nCity State, Zip\nCountry'}
      />

on chrome, the text holder is rendered as multiline properly. on firefox it's just a single line even if the text is there and on safari, the placeholder text is rendered as one line only

i've been going through different stackoverflow posts

and from what i could tell, while this wasn't allowed before, it's part of the spec now and it should work.

Has anyone gotten this to work on different browsers?

UPDATE (Nov 16): I added a "rows" attribute to the placeholder and the lines were displayed. still didn't work for safari

Upvotes: 2

Views: 448

Answers (0)

Related Questions