eschutho commented on a change in pull request #17386:
URL: https://github.com/apache/superset/pull/17386#discussion_r746869976



##########
File path: superset-frontend/src/SqlLab/components/TableElement/index.tsx
##########
@@ -77,6 +77,15 @@ const Fade = styled.div`
 const TableElement = ({ table, actions, ...props }: TableElementProps) => {
   const [sortColumns, setSortColumns] = useState(false);
   const [hovered, setHovered] = useState(false);
+  const [tableNameOverflow, setTableNameOverflow] = useState(false);
+  const tableNameRef = React.useRef<HTMLInputElement>(null);
+
+  useEffect(() => {
+    const element = tableNameRef.current;
+    if (element && element.offsetWidth < element.scrollWidth) {

Review comment:
       Oh, good point on the typescript error. You could coerce the type like 
`if ((element?.offsetWidth as number) < (element?.scrollWidth as number))` but 
in this case what you have is more readable. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to