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

Dialog renderer and css not registered when using custom configuration #307

Closed
tdamir opened this Issue Jun 22, 2017 · 1 comment

Comments

Projects
None yet
3 participants
@tdamir

tdamir commented Jun 22, 2017

I'm submitting a bug report

  • Library Version:
    1.0.0-rc.1.0.3

Please tell us about your environment:

  • Operating System:
    Windows 10

  • Node Version:
    6.9.1

  • NPM Version:
    4.5.0
  • Browser:
    all

  • Language:
    TypeScript 2.X

Current behavior:
I'm overriding the header template with my own. This is my configuration:

  aurelia.use
    .standardConfiguration()
    .plugin('aurelia-dialog', (config: DialogConfiguration) => {
      config
        .useResource('ux-dialog')
        .useResource('ux-dialog-body')
        .useResource('ux-dialog-footer')
        .useResource('attach-focus');
    })

Unfortunately with this configuration I'm getting 'DialogRenderer must implement getDialogContainer().' because the default renderer is not registered in custom mode. Looking at the source code of DialogConfiguration, it is not possible anymore to register only custom resources keeping the default resources (ie: css and renderer). This could be by design (and is a breaking change) but unfortunately the default dialog renderer is not exported so I'm unable to register it manually (ie: config.useRenderer()). The same is true for the css styles as well.

@tdamir

This comment has been minimized.

Show comment
Hide comment
@tdamir

tdamir Jun 22, 2017

Temporary hack:

      config.useDefaults();
      let resources = <Array<string>>(<any>config).resources;
      resources.splice(resources.indexOf('ux-dialog-header'), 1);

tdamir commented Jun 22, 2017

Temporary hack:

      config.useDefaults();
      let resources = <Array<string>>(<any>config).resources;
      resources.splice(resources.indexOf('ux-dialog-header'), 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment