kirby
kirby copied to clipboard
[develop] new object field some console errors
Sorry for overlooking the errors in the console before the PR merged.
Few issues
- When first click add and open the drawer
Uncaught TypeError: Cannot read properties of undefined (reading 'isOpen') Uncaught TypeError: Cannot read properties of undefined (reading 'open')
- When click
tags
field
Uncaught TypeError: Cannot read properties of undefined (reading 'focus')
Sample blueprint
fields:
person:
label: Person One
type: object
fields:
category:
label: Category
type: multiselect
options:
design: Design
architecture: Architecture
photography: Photography
3d: 3D
web: Web
name:
type: text
pages:
type: pages
files:
type: files
tags:
type: tags
Cannot reproduce this.
https://user-images.githubusercontent.com/3393422/191491705-c37dbd76-a657-40b3-85a0-87eca09dff25.mp4
Looks like you aren't running npm run dev
?
Yes, I always run my tests with build
.
Cannot reproduce it with build
either. Have you deleted the media folder before testing?
Have you deleted the media folder before testing?
Always 🙂
I've tested on Firefox and same..
Hm, I wonder if this is a Windows vs. Mac problem. I cannot reproduce it either. So weird.
I've tracked down and I've some clues.. I guess this is about click
event.
-
Triggered
click
event from object field: https://github.com/getkirby/kirby/blob/develop/panel/src/components/Forms/Field/ObjectField.vue#L19 -
Multiselect field catches the
click
event and tries to open or close the ref: https://github.com/getkirby/kirby/blob/44158e8a5856384f35b07263240abc96db16ae7e/panel/src/components/Forms/Input/MultiselectInput.vue#L205-L212
@bastianallgeier I have prepared a rough PR https://github.com/getkirby/kirby/pull/4685 for you that fixes the issue. It can give you an idea.
@bastianallgeier @distantnative Now I've steps to reproduce. Critical step is refresh (hard) the page.
- Login panel
- Edit any page that have related sample fields in first comment https://github.com/getkirby/kirby/issues/4681#issue-1380754676
- Before click object, hard refresh the page
- Click to object field
- Check console error
✅