0

With this code (reduced as much as I'm able), and checking the resulting page in multiple browsers, clicking on the "Info" Button within the Table does not trigger the onPress event the first time, but the second (or later) clicks trigger the event. The same Button without being inside the triggers the onPress the first time. What could be masking the first click?

"use client"
import * as React from 'react';
import { Button, Table } from "@nextui-org/react";
                                 
export default class Thing extends React.Component<any,any> {
                                 
  constructor(props : any) {
    super(props);         
    this.state = {
      rows: [
        { "id": 1 },
      ],
      columns : [
        { key: "actions", label: "ACTIONS", },
      ],
    };
  }
  render() {
    return (     
      <>                                                           
      <Table aria-label="Example Table" >
        <Table.Header columns={this.state.columns}>
          {(column: any) => (
            <Table.Column key={column.key}>{column.label}</Table.Column>
          )}
        </Table.Header>
        <Table.Body items={this.state.rows}>
          {(item : any) => (                                       
            <Table.Row key={item.id}>              
              {(key : any) =>
                <Table.Cell css={{ maxWidth: "500px", }}>                                                                              
                  <Button auto onPress={() => { console.log("pressed") }}> Info </Button>
                </Table.Cell>
              }                                                    
            </Table.Row>    
          )}                                                       
        </Table.Body>        
      </Table>                                                     
      </>                                                                                                                              
    );                       
  }            
};                      

0 Answers0