primereact icon indicating copy to clipboard operation
primereact copied to clipboard

tab panel inside tab view is hiding when is not enough space to display the first tab panel

Open jdsalasca opened this issue 4 years ago • 2 comments

Describe the bug

image

this is the code:

                    <TabView

                        scrollable={true}
                        className="tabview-interview-manager"
                        activeIndex={activeIndex}
                        onTabChange={onTabChangeHandler}
                    >


                        <TabPanel
                            header={"Entrevistas de " + upperCaseFirstWord(programName)}

                        >
                            {paramsOfDegree?.program != null && (

                                <CalendarInterviewPicker
                                    paintMessage={paintMessage}
                                    programId={paramsOfDegree.program}
                                    programName={programName}
                                    periodId={paramsOfDegree.period}
                                    onSendInformationAboutInterviewsByDay={onSendInformationAboutInterviewsByDay}
                                    reloadListOfInterviews={reloadListOfInterviews}
                                    setReloadListOfInterviews={setReloadListOfInterviews}
                                />

                            )}




                            <Toolbar right={ButtonToCreateNewInterviews} left={listOfInterviewsByDay?.day == null && ButtonToWatchTutorial}>  </Toolbar>

                            {listOfInterviewsByDay?.listOfInterviewsByDay?.length > 0 && (
                                <DataTable
                                    dataKey="id"
                                    responsiveLayout="scroll"
                                    className="table-interviews"
                                    header={`Listado de entrevistas para el ${listOfInterviewsByDay.day} modalidad: ${listOfInterviewsByDay.location}`}
                                    paginator rows={15}
                                    value={listOfInterviewsByDay.listOfInterviewsByDay}
                                    metaKeySelection={false}
                                    //rowClassName= {rowClass}
                                    emptyMessage={"Ninguna entrevista para los parámetros de búsqueda ingresados"}
                                >
                                    {listOfInterviewsByDay?.location === "virtual" && <Column field="id" header="Identificador" filter > </Column>}
                                    <Column field="hourLabel" header="Hora (militar)"> </Column>
                                    <Column field="interviewer.labelName" header="Entrevistador" > </Column>
                                    <Column field="duration" header="Duración" > </Column>
                                    {listOfInterviewsByDay?.location !== "virtual" && <Column filter field="location" header="Lugar de la entrevista" > </Column>}
                                    {listOfInterviewsByDay?.location === "virtual" && <Column field="googleMeetLink" header="Enlace Google Meet" > </Column>}
                                    <Column field="quota" header="Cupos" > </Column>
                                    <Column sortable field="reservedQuota" header="Cupos Reservados" > </Column>
                                    <Column body={actionBodyTemplate} exportable={false} style={{ minWidth: '8rem' }}></Column>
                                </DataTable>
                            )}


                        </TabPanel>
                        <TabPanel
                            header={"Asignacion masiva para aspirantes de " + upperCaseFirstWord(programName)}
                        >
                            <ProgramManagerInterview
                                programName={programName}
                                programId={paramsOfDegree.program}
                            />

                        </TabPanel>
                        <TabPanel
                            header={"Gestión entrevistadores de " + upperCaseFirstWord(programName)}>
                            <InterviewersManagement
                                programName={programName}
                                programId={paramsOfDegree.program}
                            />

                        </TabPanel>
                        <TabPanel
                            header={"Gestion encargados entrevistas de " + upperCaseFirstWord(programName)}
                        >
                            <ProgramManagerInterview
                                programName={programName}
                                programId={paramsOfDegree.program}
                            />

                        </TabPanel>
                    </TabView>

Reproducer

No response

PrimeReact version

^6.6.0

React version

17.x

Language

ES6

Build / Runtime

Create React App (CRA)

Browser(s)

Firefox

Steps to reproduce the behavior

  1. I create a tab view with 4 tab panel 2. When I load the component, the panels are not displayed correctly

Expected behavior

The first Tab Panel should be seen at the moment of load the component

jdsalasca avatar Sep 12 '22 23:09 jdsalasca

I have tried putting the tab view inside a div with wight 100% but it does not help

jdsalasca avatar Sep 12 '22 23:09 jdsalasca

Problem solved: this maybe could help someone: the problem was that I was adding the flex property in the className and that was causing that weird behavior, I have changed the CSS and It fix the problem c:

the problem was with : 'justify-content: center' I removed that and everything seems ok

jdsalasca avatar Sep 12 '22 23:09 jdsalasca