Skip to content

Commit

Permalink
fix: language post seleciton was bugged
Browse files Browse the repository at this point in the history
  • Loading branch information
Clovis committed Nov 1, 2024
1 parent e6cad7e commit 6a98cd2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/soapbox/features/compose/components/language_dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { useDispatch } from 'react-redux';
import { closeModal, openModal } from 'soapbox/actions/modals';
import { Input } from 'soapbox/components/ui';
import { isUserTouching } from 'soapbox/is_mobile';
import { option } from 'yargs';

const listenerOptions = supportsPassiveEvents ? { passive: true } : false;

Expand Down Expand Up @@ -176,12 +177,12 @@ const LanguageDropdown: React.FC<ILanguageDropdown> = ({
onChange(option.value);
}, [onChange]);

const handleModalActionClick: React.MouseEventHandler = (e) => {
const handleModalActionClick: React.MouseEventHandler = useCallback((e) => {
e.preventDefault();
const option = ALL_OPTIONS[e.currentTarget.getAttribute('data-index') as any];
const option = options[e.currentTarget.getAttribute('data-index') as any];
dispatch(closeModal('ACTIONS'));
onInternalChange(option);
};
}, [options, dispatch, onInternalChange]);

const handleKeyDown: React.KeyboardEventHandler = e => {
switch (e.key) {
Expand Down

0 comments on commit 6a98cd2

Please sign in to comment.