Paragraphs & OH: Additional slot row disappears after value change when used in nested paragraphs

Created on 2 June 2024, 26 days ago
Updated 27 June 2024, about 19 hours ago

Problem/Motivation

Additional slot row disappears after value change when used in nested paragraphs (paragraph in another paragraph type)

D10, admin theme Gin

Steps to reproduce

Create a paragraph structure like:

1. Component (paragraph type)
-- Some field set one (nested paragraph type)
-- -- Office hours
-- -- [other fields]
-- [other field sets

2. Click "Add time slot"

3. Change any (time) value in the new slot

4. The row will disappear (the value is still there, just visually removed)

Proposed resolution

Adjusted js file to account for script re-initiations due to paragaph changes

Remaining tasks

Test

πŸ› Bug report
Status

Needs work

Version

1.0

Component

Code - widget

Created by

πŸ‡¦πŸ‡ΊAustralia max.valetov

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @max.valetov
  • Status changed to Needs work 24 days ago
  • πŸ‡³πŸ‡±Netherlands johnv

    I have some questions about your patch.
    - the patch is not against latest version, with for example part of πŸ“Œ Refactor the JavaScript for the widget to use the once library Needs work in it. That is not a problem however to evaluate your patch. But it does already introduce some more focussing.
    - you have a problem in a specific paragraphs constellation. I presume you have no problem in a less complex layout? (there were some issues with paragraphs before)
    - in the first 2 parts, I guess the addClass/removeClass is the part that truely fixes your problem?
    - in the first 2 parts you change the UX: removing the cleared row and adding the 'Add' link of the previous row. I guess that is not part of your problem, but an additional feature? Indeed , current behaviour is more like 'clear', then 'remove'. But I feel removing the clicked-upon row is confusing.
    - in the last 2 parts, why do you switch from 'id' to 'data-drupal-selector'? Is that best practice? If so, I can change it, but it gives no technical/functional improvement, does it?

    Additionally, please check the introduction of once in #3449164-11: Refactor the JavaScript for the widget to use the once library β†’ , if it will not break your use case.
    I need some confirmation on the proposed change there.

  • πŸ‡³πŸ‡±Netherlands johnv

    Please find the remainder of your original patch, for the hide and once features.

  • πŸ‡³πŸ‡±Netherlands johnv
Production build 0.69.0 2024