Browse Source

비행승인 구역 스크롤 이벤트 수정

master
김장현 1 month ago
parent
commit
32e7191240
  1. 8
      src/containers/flight/OperationApprovalsContainer.js
  2. 2
      src/containers/flight/popup/OperationApprovalsPopupContainer.js

8
src/containers/flight/OperationApprovalsContainer.js

@ -123,8 +123,9 @@ export default function OperationApprovalsContainer({ mode }) {
const features = map
.queryRenderedFeatures(e.point)
.find(feature => feature.source === 'operationLayer');
console.log(features);
if (features) {
console.log(popupRef.current);
if (popupRef.current) {
popupRef.current.postMessage({
type: 'matchingRow',
@ -140,12 +141,11 @@ export default function OperationApprovalsContainer({ mode }) {
const targetValue = features.properties.key;
const rows = document.getElementsByClassName('ant-table-row');
const matchingRow = Array.from(rows).find(row => {
const rowKey = row.getAttribute('data-row-key');
return rowKey.startsWith(targetValue);
});
return rowKey.includes(targetValue);
});
if (matchingRow) {
matchingRow.scrollIntoView({
behavior: 'smooth',

2
src/containers/flight/popup/OperationApprovalsPopupContainer.js

@ -67,7 +67,7 @@ function OperationApprovalsPopupContainer() {
const rows = document.getElementsByClassName('ant-table-row');
const matchingRow = Array.from(rows).find(row => {
const rowKey = row.getAttribute('data-row-key');
return rowKey.startsWith(targetValue);
return rowKey.includes(targetValue);
});
if (matchingRow) {

Loading…
Cancel
Save