diff --git a/js/scripts/prop-types.js b/js/scripts/prop-types.js index b43534d4..2df6fd22 100644 --- a/js/scripts/prop-types.js +++ b/js/scripts/prop-types.js @@ -374,9 +374,9 @@ class ColorArray extends BaseType { } class ArrayType extends BaseType { - constructor(options) { + constructor(defaultValue, options) { super(options); - this.defaultValue = []; + this.defaultValue = defaultValue === undefined ? [] : defaultValue; } getTraitlet() { return `List()${this.getTagString()}`; diff --git a/js/scripts/three-class-config.js b/js/scripts/three-class-config.js index bdb11382..e9d0cb95 100644 --- a/js/scripts/three-class-config.js +++ b/js/scripts/three-class-config.js @@ -289,14 +289,14 @@ module.exports = { nullable: true, help: 'The index of the face picked (null if no face picked)', }), - modifiers: new Types.Array({ + modifiers: new Types.Array(undefined, { help: 'The keyboard modifiers held at the pick event in the following order: [SHIFT, CTRL, ALT, META]', }), object: new Types.ThreeType('Object3D', { nullable: true, help: 'The picked object (null if no object picked)', }), - picked: new Types.Array({ + picked: new Types.Array(undefined, { help: 'The other fields on the picker will always be for the first object intersection. ' + 'If ``all`` is set true, this field will be an array containing the same information ' + 'for all intersections.', @@ -304,7 +304,7 @@ module.exports = { uv: new Types.Vector2(0, 0, { help: 'The UV coordinate picked (all zero if invalid pick)', }), - indices: new Types.Array({ + indices: new Types.Array(undefined, { help: 'The vertex indices of the picked face (empty if no face picked)', }), }, @@ -365,7 +365,7 @@ module.exports = { vertices: new Types.VectorArray(), colors: new Types.ColorArray(), faces: new Types.FaceArray(), - faceVertexUvs: new Types.Array(), + faceVertexUvs: new Types.Array([[]]), lineDistances: new Types.Array(), morphTargets: new Types.Array(), morphNormals: new Types.Array(),