Skip to content

Commit

Permalink
fix: clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
KaustubhKumar05 committed May 20, 2024
1 parent 031aa5d commit 567416c
Showing 1 changed file with 1 addition and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Fragment, useCallback, useEffect, useRef, useState } from 'react';
import React, { Fragment, useCallback, useState } from 'react';
import { useDebounce, useMedia } from 'react-use';
import {
HMSPeer,
Expand Down Expand Up @@ -438,10 +438,6 @@ export const ParticipantSearch = ({
}) => {
const [value, setValue] = React.useState('');
const isMobile = useMedia(cssConfig.media.md);
const { elements } = useRoomLayoutConferencingScreen();
const inputRef = useRef<HTMLInputElement>(null);
// @ts-ignore Flag added for customiser UI
const enableAutoFocus = !elements?.participant_list?.disable_autofocus;

useDebounce(
() => {
Expand All @@ -451,13 +447,6 @@ export const ParticipantSearch = ({
[value, onSearch],
);

useEffect(() => {
if (enableAutoFocus) {
// When switching from chat to peer list, the tab retains focus due to the click
setTimeout(() => inputRef.current?.focus(), 0);
}
}, [enableAutoFocus]);

return (
<Flex
align="center"
Expand All @@ -472,7 +461,6 @@ export const ParticipantSearch = ({
>
<SearchIcon style={{ position: 'absolute', left: '0.5rem' }} />
<Input
ref={inputRef}
type="text"
placeholder={placeholder}
css={{ w: '100%', p: '$6', pl: '$14', bg: inSidePane ? '$surface_default' : '$surface_dim' }}
Expand Down

0 comments on commit 567416c

Please sign in to comment.