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.

Certain attributes behave differently given the same value

See original GitHub issue

Environment:

  • OSX 10.11.6
  • Chrome 62.0.3202.94
  • hyperapp@1.1.2

Consider the following component:

const Input = () =>
  <input type="text" spellcheck="false" aria-invalid="false" />;

I would expect this to be rendered as:

<input type="text" spellcheck="false" aria-invalid="false" />

But the actual output is:

<input type="text" spellcheck="true" aria-invalid="false" />

I’m able get the desired spellcheck value by setting it to an empty string in the component, but aria-invalid behaves differently

const Input = () =>
  <input type="text" spellcheck="" aria-invalid="" />;

Now the rendered output is:

<input type="text" spellcheck="false" aria-invalid />

Ultimately, I have to pass different values to the spellcheck and aria-invalid attributes in the component to get the same values in the output:

const Input = () =>
  <input type="text" spellcheck="" aria-invalid="false" />;
<input type="text" spellcheck="false" aria-invalid="false" />

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
osdevisnotcommented, Mar 2, 2018

Maybe I am too new to this, but can someone please shade some light on why we try to set the dom property directly element[name] = value == null ? '' : value as opposed to using element.setAttribute(name, value) always?

0reactions
frenzzycommented, Mar 7, 2018

@jorgebucaran the problem is unexpected hyperapp behavior:

const view = () => <input spellcheck="false" /> // renders =>
// actual:   <input spellcheck="true" />
// expected: <input spellcheck="false" />

fixed here: #629

Read more comments on GitHub >

github_iconTop Results From Across the Web

4. Methods Use Instance Variables: How Objects Behave
Every instance of a particular class has the same methods, but the methods can behave differently based on the value of the instance...
Read more >
How payload, variable, and attributes behave when passing ...
Let's assume in parent flow we have some Attributes, Payload, and Variables set. when we pass to the child flow using Flow reference,...
Read more >
Measure to behave differently on specific level
Firstly let me explain what I'm trying to do and what's the requirement. So basically, I have a restricted attributes in one table...
Read more >
Python: Why public and private instance attribute behave ...
It's not private vs. public, but your property name is cost so self.cost = cost triggers the property setter, but self.
Read more >
Specifying attributes and behaviors | Python 3 Object-Oriented ...
A class can define specific sets of characteristics that are shared by all objects from that class. Any specific object can have different...
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