Closed tmTara closed 5 years ago
I am using "setPattern" function in react.js, and I find a bug that in the function get parameters (matrix, margin and radius) from privateMap.get(this) is undefined, to fix this bug might get those parameters from option object witch we setting or make sure those parameters has been set in privateMap. In my case i use
const {option } = iObj;
const {matrix=iObj.matrix, margin=iObj.margin, radius=iObj.radius} = option
instead of
const { option, matrix, margin, radius } = iObj;
Looks like a typo on the rewrite for ES6.
Before rewrite:
var iObj = objectHolder[this.token], option = iObj.option, matrix = option.matrix, margin = option.margin, radius = option.radius;
After rewrite:
var option = iObj.option, matrix = iObj.matrix, margin = [iObj.margin,] radius = iObj.radius;
I create a pull request for the fix.
Hi Jan-sti,
The setPattern is not working for me. Already have your fix in https://github.com/s-yadav/patternLock/pull/29
this issue is Matrix is undefined. I think because of your change
I need to change the code to make it work, this is the change
`var option = iObj.option, matrix = iObj.matrix, margin = iObj.margin, radius = iObj.radius;
if (!matrix && iObj.option.matrix) {
matrix = iObj.option.matrix;
}
if (!margin && iObj.option.margin) {
margin = iObj.option.margin;
}
if (!radius && iObj.option.radius) {
radius = iObj.option.radius;
}`
Hi, I am trying to set the pattern dynamically but its not working. Could you please provide me an example?