lexical: fix minor spacing/size issues

This commit is contained in:
Alex Gleason 2023-09-22 15:38:27 -05:00
parent ac591e029e
commit e619ffffdd
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
3 changed files with 7 additions and 6 deletions

View File

@ -340,7 +340,7 @@ const ComposeForm = <ID extends string>({ id, shouldCondense, autoFocus, clickab
{(Component: any) => (
<Component
ref={editorStateRef}
className='my-2'
className='mt-2'
composeId={id}
condensed={condensed}
eventDiscussion={!!event}

View File

@ -152,14 +152,14 @@ const ComposeEditor = React.forwardRef<string, IComposeEditor>(({
return (
<LexicalComposer initialConfig={initialConfig}>
<div className={clsx('lexical relative', className)} data-markup>
<div className={clsx('relative', className)} data-markup>
<RichTextPlugin
contentEditable={
<div className='editor' ref={onRef} onFocus={onFocus} onPaste={handlePaste}>
<div ref={onRef} onFocus={onFocus} onPaste={handlePaste}>
<ContentEditable
className={clsx('outline-none transition-[min-height] motion-reduce:transition-none', {
'min-h-[40px]': condensed,
'min-h-[100px]': !condensed,
'min-h-[39px]': condensed,
'min-h-[99px]': !condensed,
})}
/>
</div>
@ -167,7 +167,7 @@ const ComposeEditor = React.forwardRef<string, IComposeEditor>(({
placeholder={(
<div
className={clsx(
'pointer-events-none absolute top-0 select-none text-gray-600 dark:placeholder:text-gray-600',
'pointer-events-none absolute top-0 -z-10 select-none text-[1rem] text-gray-600 dark:placeholder:text-gray-600',
placeholderClassName,
)}
>

View File

@ -505,6 +505,7 @@ const AutosuggestPlugin = ({
(payload) => {
const event = payload;
if (suggestions !== null && suggestions.size && selectedSuggestion !== null) {
// eslint-disable-next-line no-nested-ternary
const newSelectedSuggestion = event.shiftKey
? (selectedSuggestion !== 0 ? selectedSuggestion - 1 : suggestions.size - 1)
: (selectedSuggestion !== suggestions.size - 1 ? selectedSuggestion + 1 : 0);