Default value returns NaN for numeric, single-property component schemas in A-Frame 0.7.* and 0.8.0.
I noticed that single-property components may be deprecated in future releases according to #2536, however they don't currently function as documented: https://aframe.io/docs/0.8.0/core/component.html#single-property-schema
- A-Frame Version:
0.7.* and 0.8.0
- Platform / Device: Bug reproduced on all devices tested: Firefox, Chrome, Edge, Samsung Internet on Windows and Android.
- Reproducible Code Snippet or URL:
AFRAME.registerComponent( 'test-component', {
// Bug exists for types 'number' and 'int', possibly others.
schema: { type: 'number', default: 10 },
init: function() {
// Returns NaN
console.log( this.data );
}
});
Demo: https://codepen.io/dansinni/pen/vRYJQy