Browse Source

운항과 비행구역 선택시 테이블 포커스 스크롤

master
이준희 2 months ago
parent
commit
d96cdd03f2
  1. 20
      src/containers/flight/OperationApprovalsContainer.js

20
src/containers/flight/OperationApprovalsContainer.js

@ -107,8 +107,8 @@ export default function OperationApprovalsContainer({ mode }) {
}, []);
useEffect(() => {
if (areaCoordList.length !== 0) {
handlerAreaDraw();
if (areaCoordList.length > 0) {
if (areaCoordList[0].planSno !== 0) handlerAreaDraw();
} else {
handlerRemoveArea();
}
@ -123,6 +123,22 @@ export default function OperationApprovalsContainer({ mode }) {
if (features) {
setSelected([features.properties.key]);
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);
});
if (matchingRow) {
matchingRow.scrollIntoView({
behavior: 'smooth',
block: 'center',
inline: 'nearest'
});
}
}
});

Loading…
Cancel
Save