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.

After a value is typed into an input field then the value from the page state rendered is ignored

See original GitHub issue

In my use case I have a page with a form and a list of Customers. The form has a customer name. When someone clicks on a customer in the list I populate the customer form like this from the state.

  def formFieldCustomer(title: String, elId: ElementId, name: String, value: String) = {
    'div('class /= "form-group",
      'label('class /= "col-sm-3 control-label", title),
      'div('class /= "col-sm-9",
        'div('class /= "input-group",
          'input(elId, 'name /= name, 'type /= "text", 'class /= "form-control", 'placeholder /= title, 'value /= value)
        )
      )
    )
  }

Now if the user clicks on a customer in the list, the value gets set in the input field from customer state and that’s good. If the user clicks on another customer, the value gets set, that’s good.

Now if the user types in the input field, then now clicks on a customer, the customer’s value does not get set anymore, the value that was typed in the input field remains, even if I click on any customer in the list. This is a problem.

Previously as a solution I was doing:

access.property[String](bankAccountNameField).set('value, item.accountName)

But this is no good for 50 fields, its too slow.

I should also add that if I inspect the HTML DOM with Chrome inspector debugger I can see the CORRECT value is set in the HTML DOM but the value that I inputted by typing appears to still be there.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
fomkincommented, May 9, 2017

Hmm. This is looking strange. Korolev does not tracks style properties in a some special way. Possible it is a bug in the changes-inferring algorithm. The algorithm used in 0.3.0 has not have comprehensive tests so problems like this is possible. Try to shuffle attributes, it can help in such cases.

Currently I hard working under new template engine and changes-inferring algorithm (DSL will be compatible). https://github.com/fomkin/levsha It will be much faster (thousands of complex trees comparision per second), and will have very low memory-allocation rate. Also it has very strict property checks. I plan release at the end of May.

0reactions
fomkincommented, Nov 4, 2019

access.resetForm should help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

In React ES6, why does the input field lose focus after typing a ...
While using Chrome's Inspector, it looks like the whole form is being re-rendered instead of just the value attribute of the input field...
Read more >
<input>: The Input (Form Input) element - HTML
Valid for text , search , url , tel , email , password , and number , the placeholder attribute provides a brief...
Read more >
Visualization: Area Chart - Google Developers
In an area chart, the value for each series will always be stacked ... If true , the chart will start at the...
Read more >
HTML Standard
... web pages; 8 Web application APIs; 9 Communication; 10 Web workers; 11 Worklets; 12 Web storage; 13 The HTML syntax; 14 The...
Read more >
ASP.NET Core Blazor forms and input components
For input components in a form with an EditContext, the default validation behavior includes updating the field CSS class to reflect the field's...
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