Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

178
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda