SJRK-94: Adding a block fails the first time

Metadata

Source
SJRK-94
Type
Bug
Priority
Major
Status
Closed
Resolution
Fixed
Assignee
N/A
Reporter
Gregor Moss
Created
2018-05-25T10:01:28.993-0400
Updated
2018-05-25T17:05:45.828-0400
Versions
N/A
Fixed Versions
N/A
Component
  1. Storytelling Tool UI

Description

At the time of filing, in the SJRK-91 branch (https://karisma-stories.floeproject.org/storyEdit.html), attempting to add a new block for the first time will fail without adding the block. Subsequent attempts to add a block will work just fine.

This does not occur in the "main" SJRK-49 branch (https://stories.floeproject.org/), so it is something which was added in as part of the rush to get it working for Karisma.

Comments

  • Gregor Moss commented 2018-05-25T16:03:36.755-0400

    The issue seems to be occurring as a result of the page's uiLanguage value being changed when the block add buttons are being clicked. Additionally, something is setting the value to "undefined" after the initial creation, and this is likely the root cause of the issue.

  • Gregor Moss commented 2018-05-25T17:05:45.825-0400

    The bug was cause by the page loading the language from the cookie, but if the cookie was not set then it would set the language to "undefined", triggering the editor DOM to be redrawn, removing any dynamically added elements before the context change could be registered