Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Placard contenteditable div support #1646

Conversation

kevinparkerson
Copy link
Contributor

Fixes #1612 by allowing contenteditable divs to be used as the .placard-field element in placard. I've made it default to look and behave like a regular input, though you can add data-textarea="true" to the .placard-field element to make it instead look and behave like a textarea.

Additionally, I fixed a bug I noticed with ellipsis for textareas.

Documentation will need to be updated separately.

@interactivellama
Copy link
Contributor

I think the logic is sound. Can you change isDiv to something more descriptive like isContentEditableDiv? And should we check that's it's content editable when create isDiv?
I'm coming from the greenfield of Facades, so any additional comments (especially in the constructor) would be nice.

(a keyCode object map would be nice for readability, too, but that's not what you are in there to add).

@kevinparkerson
Copy link
Contributor Author

@interactivellama I can change the var name to isContentEditableDiv, though it shouldn't check if it is content editable, b/c if it is disabled on init contenteditable="true" wouldn't be present and the control would think it's a textarea

@interactivellama
Copy link
Contributor

Yeah, you're right. Let's just comment the constructor.
// Placard supports four types of input fields. A <div> that is content editable or an <input>. Either can function as a text field or a text area.

interactivellama added a commit that referenced this pull request Dec 3, 2015
…support

Placard contenteditable div support
@interactivellama interactivellama merged commit 50c64ff into ExactTarget:master Dec 3, 2015
@interactivellama interactivellama added this to the 3.13.0 milestone Dec 3, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make placard support non-input/textarea this.$field elements
2 participants