caplin / FlexLayout

Docking Layout Manager for React
MIT License
919 stars 173 forks source link

Uncaught TypeError: parent.getSelected is not a function #429

Closed xman2310 closed 8 months ago

xman2310 commented 8 months ago

Describe the bug

Utils.ts:51 Uncaught TypeError: parent.getSelected is not a function at adjustSelectedIndex (Utils.ts:51:1) at TabSetNode.drop (TabSetNode.ts:402:1) at Model.doAction (Model.ts:299:1) at Layout.doAction (Layout.tsx:340:1) at Layout.onDragEnd [as _fDragEnd] (Layout.tsx:1116:1) at DragDrop._onMouseUp (DragDrop.ts:341:1)

Your Example Website or App

https://stackblitz.com/edit/react-ssmdjq?file=src%2FApp.js

Steps to Reproduce the Bug or Issue

  1. Drag the Rule2 Tab to the right.
  2. Drag Rule1 TabSet to the bottom right.

Expected behavior

Resulting in 'Uncaught TypeError: parent.getSelected is not a function'

Operating System

Window

Browser Type?

Crome

Browser Version

버전 120.0.6099.109(공식 빌드) (64비트)

Screenshots or Videos

https://github.com/caplin/FlexLayout/assets/78667784/02eca344-9bd9-4131-8498-d21f9464fae4

Additional context

No response

nealus commented 8 months ago

The problem is your layout json, you have a tabset within a tabset, the tabset should have a parent row like this:

layout: { type: 'row', children: [ { type: 'tabset', children: [

The main layout is defined with rows within rows that contain tabsets that themselves contain tabs.

xman2310 commented 8 months ago

Thank you. I've solved the problem.