Skip to content

v2.2.0 — Gridory

Choose a tag to compare

@VictorDiazJauregui VictorDiazJauregui released this 09 Nov 16:26
· 24 commits to main since this release
59954d8

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 · Español

English

Upgrade

npm install gridory@2.2.0

New

  • 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.
    ignoreTextSelectionClick on DataTable and CardGrid makes that click be ignored: the text stays selected and
    onRowClick is not called, nor getRowHref followed. 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 use getRowHref.
  • ignoreRowClick on 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.0

Novedades

  • 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. ignoreTextSelectionClick en DataTable y CardGrid hace que ese clic se ignore: el texto queda
    seleccionado, no se llama a onRowClick ni se sigue getRowHref. 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 usan getRowHref.
  • ignoreRowClick en 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.