Skip to content

Commit

Permalink
Extend firefox compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
1-Harshit committed Nov 17, 2023
1 parent e4a2240 commit f9d55dd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
11 changes: 9 additions & 2 deletions src/components/button/FontFaceMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ export default function Default() {
const boxBg = useColorModeValue("secondaryGray.300", "whiteAlpha.100");

const handleFontFaceChange = (name: string) => {
document.execCommand("fontName", true, name);
document.execCommand("styleWithCSS", false, "true");
document.execCommand("fontName", false, name);
document.execCommand("styleWithCSS", false, "false");
};

const FontFaceOption = ({ face }: { face: string }) => (
Expand All @@ -46,7 +48,12 @@ export default function Default() {
color={textColor}
bg={boxBg}
>
<MenuButton fontWeight="bold" color={textColor} as={IconButton} id="font-face-button">
<MenuButton
fontWeight="bold"
color={textColor}
as={IconButton}
id="font-face-button"
>
<IconBox
icon={
<Icon w="20px" h="20px" as={MdTextFormat} color={textColor} />
Expand Down
4 changes: 3 additions & 1 deletion src/components/button/FontSizeMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ export default function Default() {
const boxBg = useColorModeValue("secondaryGray.300", "whiteAlpha.100");

const handleFontSizeChange = (size: string) => {
document.execCommand("fontSize", true, size);
document.execCommand("styleWithCSS", false, "true");
document.execCommand("fontSize", false, size);
document.execCommand("styleWithCSS", false, "false");
};

const FontMenuOption = ({ index }: { index: number }) => {
Expand Down

0 comments on commit f9d55dd

Please sign in to comment.