- Issue created by @joelsteidl
- Merge request !303422691-allow-drupalsettings-to: adds library_info_alter to replace the... β (Open) created by joelsteidl
drupalSettings are not available in Storybook because of https://www.drupal.org/project/drupal/issues/2592925 β .
I'm not clear if this is the right module to fix this in.
Access Storybook when functionality relies on drupalSettings being available.
https://www.drupal.org/project/drupal/issues/2592925 β prevents drupalSettings getting attached inside of Storybook because the markup is different.
Original
const settingsElement = document.querySelector(
'head > script[type="application/json"][data-drupal-selector="drupal-settings-json"], body > script[type="application/json"][data-drupal-selector="drupal-settings-json"]',
);
Suggested Change
const settingsElement = document.querySelector(
'head > script[type="application/json"][data-drupal-selector="drupal-settings-json"], body > script[type="application/json"][data-drupal-selector="drupal-settings-json"], #storybook-root > div > script[type="application/json"][data-drupal-selector="drupal-settings-json"]',
);
I'm unclear if this opens up any sort of security concerns.
Overwriting core's core/drupalSettings library.
Active
2.0
Code