Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(richtext-lexical)!: improve floating select menu Dropdown classNames #4444

Merged
merged 1 commit into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ export function DropDown({
type="button"
>
<Icon />
<i className={`${buttonClassName}-caret`} />
<i className="floating-select-toolbar-popup__dropdown-caret" />
</button>

{showDropDown &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,23 @@ export const ToolbarDropdown = ({
classNames,
editor,
entries,
sectionKey,
}: {
Icon?: React.FC
anchorElem: HTMLElement
classNames?: string[]
editor: LexicalEditor
entries: FloatingToolbarSectionEntry[]
sectionKey: string
}) => {
return (
<DropDown
Icon={Icon}
buttonAriaLabel="Formatting options"
buttonClassName={[baseClass, ...(classNames || [])].filter(Boolean).join(' ')}
buttonAriaLabel={`${sectionKey} dropdown`}
buttonClassName={[baseClass, `${baseClass}-${sectionKey}`, ...(classNames || [])]
.filter(Boolean)
.join(' ')}
key={sectionKey}
>
{entries.length &&
entries.map((entry) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,16 @@ function ToolbarSection({
anchorElem={anchorElem}
editor={editor}
entries={section.entries}
sectionKey={section.key}
/>
</React.Suspense>
) : (
<ToolbarDropdown anchorElem={anchorElem} editor={editor} entries={section.entries} />
<ToolbarDropdown
anchorElem={anchorElem}
editor={editor}
entries={section.entries}
sectionKey={section.key}
/>
))}
{section.type === 'buttons' &&
section.entries.length &&
Expand Down
Loading