`Tooltip` is incompatible with callback refs
Los mantenedores suelen responder en 2 días
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 70/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- react, typescript
- Área
- frontend
Línea de trabajo
Start at the Tooltip component's ref handling and reproduce the callback-ref example from the issue, comparing it with the object-ref case. Done means a callback ref passed to Tooltip still receives the underlying element and the tooltip appears when hovering the wrapped Button.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
When I encountered https://github.com/primer/react/issues/8373 I moved my callback ref to the wrapping Tooltip . This appeared to forward the ref to the underlying element as I wanted. However, if the passed ref is a callback ref, the tooltip never appears. This is not the case for an object ref.
Steps to reproduce
This breaks, even though it typechecks just fine. The log does get called, but the tooltip does not appear:
const logRef = useCallback(element => console.log(element), [])
return <Tooltip ref={logRef} text="Example"><Button>Button text</Button></Tooltip>
This works, but isn't a callback ref:
const logRef = useRef(null)
return <Tooltip ref={logRef} text="Example"><Button>Button text</Button></Tooltip>
And this shows the tooltip but never calls the log (#8373):
const logRef = useCallback(element => console.log(element), [])
return <Tooltip text="Example"><Button ref={logRef}>Button text</Button></Tooltip>
Version
v38.37.0
Browser
No response
- Lenguaje dominante
- TypeScript
- Estrellas
- 3.9k
- Forks
- 697
- Merge medio
- 3 d 12 h
- PR fusionados (30 d)
- 51
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de primer/react
-
PageHeader.Title does not seem to accept id propPosiblemente ocupada @TylerJDev la tomó hace 3 días. Abiertocomponent: PageHeader react staff
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
primer/react#8474 · 1 comentario · 1 reacción · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
The padding prop seems to have no effect with PageLayout.SidebarPosiblemente ocupada @minwookshin la tomó hace 14 días. Abiertocomponent: PageLayout react staff
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
primer/react#8470 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 2 días
-
bug component: Spinner react
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
primer/react#8423 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Low contrast in SelectAbiertowaiting for author response
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
primer/react#8172 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Checkbox: replace useLayoutEffect with ref callback for indeterminate propQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abiertocomponent: Checkbox react
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
Todos los issues de primer/react
Issues similares
-
test: make the #3408 Claude OAuth token fixture obviously fake so secret scanners stop flagging itAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
code-yeongyu/senpi#3436 ·
Los mantenedores suelen responder en 1 día
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
lingdojo/kana-dojo#32505 · 1 comentario · 5 reacciones ·
Los mantenedores suelen responder en 1 día
-
code-quality refactoring
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
github/gh-aw-firewall#10040 ·
Los mantenedores suelen responder en 1 día
-
review-followup
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
griffinwork40/agent-afk#3868 ·
Los mantenedores suelen responder en 1 día
-
area: import-export bug status: needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
amatya-aditya/obsidian-rss-dashboard#1191 ·
Los mantenedores suelen responder en 1 día