fix: set message translate dropdown height (#6954)

fix: improve dropdown menu styling and placement in MessageMenubar component

- Set a maximum height and overflow behavior for the dropdown menu to enhance usability.
- Changed the dropdown placement from "topRight" to "top" for better alignment with the UI.
This commit is contained in:
fullex 2025-06-07 17:17:02 +08:00 committed by GitHub
parent a83e40389f
commit 043b13e359

View File

@ -382,6 +382,10 @@ const MessageMenubar: FC<Props> = (props) => {
{!isUserMessage && ( {!isUserMessage && (
<Dropdown <Dropdown
menu={{ menu={{
style: {
maxHeight: 250,
overflowY: 'auto'
},
items: [ items: [
...TranslateLanguageOptions.map((item) => ({ ...TranslateLanguageOptions.map((item) => ({
label: item.emoji + ' ' + item.label, label: item.emoji + ' ' + item.label,
@ -437,7 +441,7 @@ const MessageMenubar: FC<Props> = (props) => {
onClick: (e) => e.domEvent.stopPropagation() onClick: (e) => e.domEvent.stopPropagation()
}} }}
trigger={['click']} trigger={['click']}
placement="topRight" placement="top"
arrow> arrow>
<Tooltip title={t('chat.translate')} mouseEnterDelay={1.2}> <Tooltip title={t('chat.translate')} mouseEnterDelay={1.2}>
<ActionButton className="message-action-button" onClick={(e) => e.stopPropagation()}> <ActionButton className="message-action-button" onClick={(e) => e.stopPropagation()}>