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.

Overrides do not work onload if 'preset' is set

See original GitHub issue

When a preset has been defined, e.g. preset: starry; then the preset values are not correctly overridden e.g. 'preset: starry; grid: none;' will not remove the grid. Custom values are lost during update function when you use this.presets[this.data.preset].

I have made a temporary fix, which you may want to improve:

if (oldData.preset === undefined || oldData.preset !== this.data.preset) {
      var newData = Object.assign({}, this.presets[this.data.preset]);
      Object.assign(newData, this.el.components.environment.attrValue);
      this.el.setAttribute('environment', newData);
      return;
    }

UPDATE: My fix doesn’t actually quite work, due to all the if (data.property != oldData.property) code. So not quite sure of optimal way to fix this.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
tbalouetcommented, Jul 4, 2017

Just had the same problem. I’ve been silly hacking it with some

setTimeout(function(){
  document.querySelector("#sceneEnv").setAttribute("environment", "lightPosition", "0 5 10");
}, 1000);

Otherwise having <a-entity id="sceneEnv" environment="preset:forest;lightPosition=0 5 -10;"></a-entity> doesn’t work by itself.

Interested if you get to fix it! (great component btw!)

0reactions
vesper8commented, Jan 2, 2020

I tried many ways of removing the fog from the presets. I successfully remove it but it still causes the conflict with particles, even though it’s clearly removed using setAttribute. It’s visually gone and I can also see that it’s gone from the element inside the debugger, yet it still causes issues. I had to revert to manually changing the hardcoded values inside the presets from this distribution file.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Not able to Override the default value for "Valid - ServiceNow
For this i have created a dictionary override , to override the default value. but its not working. its setting to-01-01-2100.
Read more >
Form_Load() 'event' or Override OnLoad() - Stack Overflow
You should always override OnLoad (). Using the event is only appropriate when another class would be interested in the event.
Read more >
Override webpage resources with local copies (Overrides tab)
The Overrides feature in the Sources tool helps you solve this problem. You can now take a resource of the current webpage and...
Read more >
Here's Why You Should Be Using Overrides in Chrome Devtools
Overrides are persistent as long as the devtools are open. When you override a file and make changes to it, the changes will...
Read more >
Configuration override system - Drupal
When a configuration form that contained overridden values was ... overridden via $config within settings.php will not be viewable from the ...
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