Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grid Freezing #1989

Closed
wiki01 opened this issue Nov 21, 2023 · 2 comments
Closed

Grid Freezing #1989

wiki01 opened this issue Nov 21, 2023 · 2 comments
Labels

Comments

@wiki01
Copy link

wiki01 commented Nov 21, 2023

electron + vue2 를 사용하고 있으면

버전은 아래와 같습니다
"electron": "^13.0.0",
"vue": "2.6.14",
"tui-grid": "^4.21.19",

사용자가 all 체크박스 클릭시 Freezing 현상이 발생합니다.
또한 api 에서 checkAll or check 실행하여도 Freezing 발생합니다.

반면에 사용자가 개별 행에 체크박스를 클릭시에는 문제가 없습니다

환경이 문제일까요?

@wiki01 wiki01 added the Bug label Nov 21, 2023
@wiki01
Copy link
Author

wiki01 commented Nov 21, 2023

`function defineReactive$$1 (
obj,
key,
val,
customSetter,
shallow
) {
var dep = new Dep();

var property = Object.getOwnPropertyDescriptor(obj, key);
if (property && property.configurable === false) {
return
}

// cater for pre-defined getter/setters
var getter = property && property.get;
var setter = property && property.set;
if ((!getter || setter) && arguments.length === 2) {
val = obj[key];
}

var childOb = !shallow && observe(val);
Object.defineProperty(obj, key, {
enumerable: true,
configurable: true,
get: function reactiveGetter () {
var value = getter ? getter.call(obj) : val;
if (Dep.target) {
dep.depend();
if (childOb) {
childOb.dep.depend();
if (Array.isArray(value)) {
dependArray(value);
}
}
}
return value
},
set: function reactiveSetter (newVal) {
var value = getter ? getter.call(obj) : val;
/* eslint-disable no-self-compare /
if (newVal === value || (newVal !== newVal && value !== value)) {
return
}
/
eslint-enable no-self-compare */
if (process.env.NODE_ENV !== 'production' && customSetter) {
customSetter();
}
// #7981: for accessor properties without setter
if (getter && !setter) { return }
if (setter) {
setter.call(obj, newVal);
} else {
val = newVal;
}
childOb = !shallow && observe(newVal);
dep.notify();
}
});
}`

이분분에서 get 과 set 이 순환참조하여 무한히 반복하여 호출되고 있습니다

@wiki01 wiki01 closed this as completed Nov 21, 2023
@wiki01
Copy link
Author

wiki01 commented Nov 21, 2023

@toast-ui/vue-grid 를 사용하였지만
계속 문제가 발생힙니다.

발생 조건 1
grid.appendRows([{}, {}, {}])
-> grid.appendRow({}) 로 변경하니 우선 해결됨

발생 조건 2
Copy and Paste

복사 붙여넣기시 행 테이블에 초과되는 부분에 붙여넣기 발생시 그 다음 행 수정시 freezing 발생
붙여넣기로 추가된 행을 삭제해도 freezing 발생

beforeChange 로 GridEvent.stopped = false 로 변경하면 문제가 발생하진 않지만 여전히 행은 추가되어 있음

vue 버전이 일치하지 않아서 그렇지.... 해결방법을 찾지 못하였습니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant