Skip to content

Input type of :text containing # does not appear in edit form #274

@DylanGriffith

Description

@DylanGriffith

We're trying to build a markdown editing field and when we add a heading using # the text area appears empty after saving then going back to edit it.

We've noticed that there is no explicit documentation for text areas (ie input :field_name, type: :text). Is this supported?

Everything else seems to work just fine, we get a textarea and can pass through a rows attribute but editing is empty when there is a hash at the start of the first line.

Note that the hash does not cause this issue if there is anything other than whitespace before it.

Reproduction Steps

  1. Create a field with type text like so:
input :field_name, type: :text
  1. Add some content to the field with a hash on the first line like:
# Content that will disappear
  1. Save the model
  2. Edit the model and notice that the textarea is now empty

/cc @joshprice

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions