prateekbh / preact-material-components

preact wrapper for "Material Components for the web"
https://material.preactjs.com
MIT License
553 stars 81 forks source link

Label and fullwidthTextField #1241

Closed gopalramadugu closed 5 years ago

gopalramadugu commented 5 years ago

I am getting below warning in console and this seems to be messing up the rendering of the component. Is this a bug or a know restriction ? I have an address field which uses the full width property. Can you please guide me here ?

Passing a "label" prop is not supported when using a "fullwidth" text field.

prateekbh commented 5 years ago

yeah full width text fields wont have labels on them.. a restriction from material guidelines you can either use placeholder or create a label of your own if you really really need it

gopalramadugu commented 5 years ago

Thank you @prateekbh. I have one more question. During navigation If I visit a page multiple times on few occasions I am getting below error. This seems to happen If I set state on loading of the page. The this.MdComponent seems to be set to null. I am setting the state in componentDidMount.

Uncaught (in promise) TypeError: Cannot set property 'value' of undefined at TextFieldInput.componentWillReceiveProps (index.js:81) at setComponentProps (preact.mjs:464) at buildComponentFromVNode (preact.mjs:632) at idiff (preact.mjs:257) at innerDiffNode (preact.mjs:355) at idiff (preact.mjs:292) at diff (preact.mjs:218) at renderComponent (preact.mjs:573) at setComponentProps (preact.mjs:480) at buildComponentFromVNode (preact.mjs:632)

gopalramadugu commented 5 years ago

@prateekbh Below is the codesanbox. I am using router and setting state from query parms. Can you please help me with this ?

https://codesandbox.io/s/xv0rrx62n4

gopalramadugu commented 5 years ago

The issue seems to be specific to componentdidmount. If I set state in constructor I dont see same issue.

cromefire commented 5 years ago

There is a missing condition

gopalramadugu commented 5 years ago

@cromefire Can I please know when this is scheduled for release ?

cromefire commented 5 years ago

@cromefire Can I please know when this is scheduled for release ?

@prateekbh

prateekbh commented 5 years ago

today