question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HTML properties overwritten

See original GitHub issue

When using the <input type="password" {...form.$('username').bind()} /> syntax, the type seems to be overwritten with “text”, even though I didn’t specify it in form field definitions. It doesn’t seem right that form definition overrides the HTML. Am I missing something?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
foxhound87commented, Apr 10, 2017

anyway the packages does not force you to use the bind() method. You can pass each props manually to the input. Or if you want to use bind() you can create a new default bindings rewriter/template omitting the type prop.

0reactions
foxhound87commented, Apr 10, 2017

You can also create a component like this:

const MyTextField = observer(({
  field,
  type = 'text',
  placeholder = null,
  validatingText = 'validating...',
  // define other props and pass them to the bind() method
}) => (
  <MaterialTextField {...field.bind({ type, placeholder, validatingText })} />
));

and use it with explicit props definition:

<MyTextField type="password" />
Read more comments on GitHub >

github_iconTop Results From Across the Web

Override existing HTML Element attribute and property with ...
I was wondering if its possible to override existing HTML Element attribute and property accessors (getters and setters) with Javascript ...
Read more >
Overwritten property — CodeQL query help documentation
Rename the properties to have different names. Example¶. In the following example, the object literal assigned to point has two definitions of property...
Read more >
Code Inspection: Overwritten property - PhpStorm
Reports a duplicated CSS property within a ruleset. Respects shorthand properties. Example: .foo { margin-bottom: 1px; margin-bottom: 1px; /* ...
Read more >
CSS Overriding Variables
Override Global Variable With Local Variable. From the previous page we have learned that global variables can be accessed/used through the entire document, ......
Read more >
Object.assign() - JavaScript - MDN Web Docs
Properties in the target object are overwritten by properties in the sources if they have the same key. Later sources' properties overwrite ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found