Materialize.css remove styling from input element

Martins Untals

I want to make Materialize.css cards editable on doubleclick. To do that I place input within card div, instead of p.

div.row
each cards
  div.col.m4.s12
    div.card.teal
      div.card-content.white-text
        if openCard
          //input(type='text' value='#{text}')              
          textarea.materialize-textarea #{text}
        else                   
          p #{text}

problem is that input (and textarea) elements have extensive material design styling, including line underneath the input. In other occasions it looks very neat, but inside the card it is completely unnecessary.

Is there a way how to remove styling from input element, so it would be usable in such double-click edit mode?

Or maybe there are other solutions, how to do edit with double-click on card, that would not involve reuse of previously styled elements?

p.s. I run it within Meteor, and there is Jade preprocessor. However, those facts should not affect neither the question, nor answer.

kaaposc

If double-click isn't essential for other functionality, you can optimize by dropping both double-click and textarea leaving just <p> with added attribute contentEditable="true". Also use onBlur event listener to save edited text.

So in jade file you would have this:

div.row
each cards
  div.col.m4.s12
    div.card.teal
      div.card-content.white-text
        p(contentEditable="true") #{text}

And in template events this:

'blur .card-content p': function(event) {...}

P.S. While testing locally found out weird issue with chrome: additional div on enter - be sure to take it in account.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Remove styling from input

From Dev

Materialize CSS remove disabled input field not working

From Dev

Remove Styling from Input Field

From Dev

Styling input element using only CSS

From Dev

CSS: Styling an input element's text (as opposed to the input element itself)?

From Dev

Materialize css date input

From Dev

CSS / Bootstrap 3: remove styling from links

From Dev

CSS nav link styling: remove styling of other element & remove double border when hovered on selected

From Dev

CSS Styling for Artificial Text Input from DIV to mimic HTML input

From Dev

Materialize CSS - Collapsible & Date Input

From Dev

Remove bootstrap styling on pre element

From Dev

Styling md-input-element

From Dev

CSS Styling for PHP Input Button

From Dev

Styling a disabled input with css only

From Dev

CSS 3 video element styling

From Dev

How to remove the caret from an input element

From Dev

How to remove the caret from an input element

From Dev

Materialize css- input range value popup

From Dev

Materialize - disable form styling

From Dev

Materialize css - dynamically load tabs element

From Dev

Materialize css - dynamically load tabs element

From Dev

Materialize CSS Select not Closing after selecting element

From Dev

Remove opacity from carousel images in Materialize design

From Dev

Remove opacity from carousel images in Materialize design

From Dev

How to exclude Materialize style from one element

From Dev

Cannot remove the styling of the input field in jquery mobile

From Dev

Cannot remove the styling of the input field in jquery mobile

From Dev

Polymer - Styling paper-input element

From Dev

Styling the height of a input type='file' element in chrome

Related Related

HotTag

Archive