Skip to content

Instantly share code, notes, and snippets.

@berkinanik
berkinanik / popover.tsx
Last active April 24, 2025 19:25
React 19 - Radix-UI Popover screen overflow solution
function PopoverContent({
ref,
...props
}: React.ComponentProps<typeof PopoverPrimitive.Content>) {
const handleContentHeight = React.useCallback((el: HTMLDivElement | null) => {
if (el) {
const availableHeight = parseInt(
window
.getComputedStyle(el)
.getPropertyValue('--radix-popper-available-height')
@berkinanik
berkinanik / replaceTurkishCharacters.ts
Created October 11, 2024 14:54
Replace Turkish Characters with Non-Accented Equivalents in JS
const TurkishCharMap: Record<string, string> = {
Ç: 'C',
ç: 'c',
Ğ: 'G',
ğ: 'g',
İ: 'I',
ı: 'i',
Ö: 'O',
ö: 'o',
Ş: 'S',