Repository navigation
v2.2.0 — Gridory
·
24 commits
to main
since this release
Minor release of Gridory: rows and cards can let the user select their text to copy it without opening them.
Everything new is opt-in: without the new prop the table and the card grid behave exactly as in 2.1.0.
English
Upgrade
npm install gridory@2.2.0New
- Table and cards: select text without opening the row. Until now, dragging over the text of a row or a card to
copy it (an email, a company, an amount) ended in a click that opened it, and the selection was lost.
ignoreTextSelectionClickonDataTableandCardGridmakes that click be ignored: the text stays selected and
onRowClickis not called, norgetRowHreffollowed. A plain click opens the row as always.
<DataTable columns={columns} data={quotes} onRowClick={openQuote} ignoreTextSelectionClick />Good to know
- Only text selected inside that row or card counts: a selection elsewhere on the page never blocks a click.
- Opening the link in a new tab (Ctrl/Cmd + click, middle click), Enter and Ctrl/Cmd + Enter do not change.
- Limits: the first click of a double click on a word still opens the row, and a click right on the text just
selected first clears it; the next click opens the row. - If your app already checks the selection inside its own
onRowClick, turn the prop on and remove that check: it
now also covers rows that only usegetRowHref. ignoreRowClickon a column is still there and still turns that column off for every gesture.
See Row click and row links
in the table guide and Card click and card links
in the card grid guide.
A later major version may turn this behavior on by default.
Español
Actualizar
npm install gridory@2.2.0Novedades
- Tabla y tarjetas: seleccionar texto sin abrir la fila. Hasta ahora, arrastrar sobre el texto de una fila o de
una tarjeta para copiarlo (un email, una empresa, un monto) terminaba en un clic que la abría, y la selección se
perdía.ignoreTextSelectionClickenDataTableyCardGridhace que ese clic se ignore: el texto queda
seleccionado, no se llama aonRowClickni se siguegetRowHref. Un clic simple abre la fila como siempre.
<DataTable columns={columns} data={quotes} onRowClick={openQuote} ignoreTextSelectionClick />Para tener en cuenta
- Solo cuenta el texto seleccionado dentro de esa fila o tarjeta: una selección en otra parte de la página nunca
bloquea un clic. - Abrir el enlace en otra pestaña (Ctrl/Cmd + clic, rueda), Enter y Ctrl/Cmd + Enter no cambian.
- Límites: el primer clic de un doble clic sobre una palabra todavía abre la fila, y un clic justo sobre el texto
recién seleccionado primero lo deselecciona; el clic siguiente abre la fila. - Si tu app ya revisa la selección dentro de su propio
onRowClick, activá la prop y borrá esa revisión: ahora
también cubre las filas que solo usangetRowHref. ignoreRowClicken una columna sigue existiendo y sigue apagando esa columna para todos los gestos.
Ver Clic en fila y filas como enlace
en la guía de la tabla y Clic en la tarjeta y tarjetas como enlace
en la guía de tarjetas.
Una próxima versión mayor podría traer este comportamiento activado por defecto.