Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

180
Vistas
How to determine from an ag-grid cell editof whether is opened by tab navigation or not?

Currently this is works perfectly when the cell editor is opened by enter (I can see 13 in the keyPress prop, but it's null when its opened by tab navigation)

   export const CellEditor = forwardRef((props, ref) => {
const { value, api: gridApi, keyPress, column } = props
const isOpenedByEnter = 13 === keyPress
  // the above is null when the cell editor is opened by tab navigation, and no field for moude events
const checkboxRef = useRef()
const initialValue = isEmptyValue(value) ? undefined : value
const [checkboxValue, setCheckboxValue] = useState(initialValue)

useImperativeHandle(ref, () => {
  return {
    getValue: () => {
      return checkboxValue
    },

    isPopup() {
      return false
    },

    afterGuiAttached: () => {
      isOpenedByEnter && toggleCheckbox()
    },
  }
})

const toggleCheckbox = () => {
  setCheckboxValue((prevCheck) => !prevCheck)
}


const handleOnChange = (clickEvent) => {
  setCheckboxValue(clickEvent.target.checked)
}

return (
  <div>
    <input type="checkbox" ref={checkboxRef} checked={!!checkboxValue} onChange={handleOnChange} />
  </div>
)})
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda