Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DicePicker results in exception #3

Open
wcroteau opened this issue Nov 3, 2022 · 0 comments
Open

DicePicker results in exception #3

wcroteau opened this issue Nov 3, 2022 · 0 comments

Comments

@wcroteau
Copy link

wcroteau commented Nov 3, 2022

NOTE: This may be a case of mis-use or invalid configuration. The documentation is notably sparse regarding how to configure the DicePicker so this is my "best guess" based on the documentation as written.

When I attempt to include the dice-picker addon it results in an error:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'target')
    at new dicePicker (dicePicker.js:59:27)
    at index.js:107:22
dicePicker @ dicePicker.js:59
(anonymous) @ index.js:107

As a setup all I've done is attempt to create a new DickPicker when the Box.init() promise resolves - exactly the way DisplayResults is created...

Box.init().then(async (world) => {
   ...
   const dicePicker = new DicePicker();

   const Display = new DisplayResults('#dice-box');
   ...
});

The error seems to indicate that the target is undefined (despite the documentation indicating that it defaults to document.body) however I've also tried setting the target via options to { target: 'body' } with the same results.

Finally, I've also tried targeting a custom element: {target: '#picker-div'} and in this case the picker DOES display without exception however it is not relative to the target element I specified (in this case I would have expected it to display within the div I specified so that I can control placement and visibility however it seems to be positioned absolutely on the page... (perhaps a separate issue?) similar to the way Dice-Box gets generated within its target (again so that I can control when/where it is displayed...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant