diff --git a/airflow/www/static/js/dag/details/taskInstance/Logs/LogBlock.tsx b/airflow/www/static/js/dag/details/taskInstance/Logs/LogBlock.tsx index ab33c5b416926..9072027e75d1c 100644 --- a/airflow/www/static/js/dag/details/taskInstance/Logs/LogBlock.tsx +++ b/airflow/www/static/js/dag/details/taskInstance/Logs/LogBlock.tsx @@ -39,14 +39,12 @@ const LogBlock = ({ const [autoScroll, setAutoScroll] = useState(true); const logBoxRef = useRef(null); - const codeBlockBottomDiv = useRef(null); const offsetTop = useOffsetTop(logBoxRef); const scrollToBottom = () => { - codeBlockBottomDiv.current?.scrollIntoView({ - block: "nearest", - inline: "nearest", - }); + if (logBoxRef.current) { + logBoxRef.current.scrollTop = logBoxRef.current.scrollHeight; + } }; useEffect(() => { @@ -122,7 +120,6 @@ const LogBlock = ({ > {/* eslint-disable-next-line react/no-danger */}
-
); }; diff --git a/airflow/www/static/js/utils/useOffsetTop.ts b/airflow/www/static/js/utils/useOffsetTop.ts index e466ba8f52de9..011d715a3bcb6 100644 --- a/airflow/www/static/js/utils/useOffsetTop.ts +++ b/airflow/www/static/js/utils/useOffsetTop.ts @@ -21,7 +21,7 @@ import { debounce } from "lodash"; import React, { useEffect, useState } from "react"; // For an html element, keep it within view height by calculating the top offset and footer height -const useOffsetTop = (contentRef: React.RefObject) => { +const useOffsetTop = (contentRef: React.RefObject) => { const [top, setTop] = useState(0); useEffect(() => { diff --git a/tests/providers/fab/auth_manager/cli_commands/test_user_command.py b/tests/providers/fab/auth_manager/cli_commands/test_user_command.py index 3e319148f15a7..20ee0fe333526 100644 --- a/tests/providers/fab/auth_manager/cli_commands/test_user_command.py +++ b/tests/providers/fab/auth_manager/cli_commands/test_user_command.py @@ -389,9 +389,9 @@ def test_cli_add_user_role(self, create_user_test4): user_command.users_manage_role(args, remove=False) assert 'User "test4" added to role "Op"' in stdout.getvalue() - assert _does_user_belong_to_role(appbuilder=self.appbuilder, email=TEST_USER1_EMAIL, rolename="Op"), ( - "User should have been added to role 'Op'" - ) + assert _does_user_belong_to_role( + appbuilder=self.appbuilder, email=TEST_USER1_EMAIL, rolename="Op" + ), "User should have been added to role 'Op'" def test_cli_remove_user_role(self, create_user_test4): assert _does_user_belong_to_role(