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

Download-href doesn't work in paper-dialog #511

Closed
BennyAlex opened this issue Oct 6, 2016 · 20 comments
Closed

Download-href doesn't work in paper-dialog #511

BennyAlex opened this issue Oct 6, 2016 · 20 comments
Labels

Comments

@BennyAlex
Copy link

If I have a link to download a file from the backend, inside an dialog e.g.

{{#paper-dialog fullscreen=true onClose=(action "close") clickOutsideToClose=true}}
  {{#paper-dialog-content}}
    Dialog-Content
  {{/paper-dialog-content}}
  {{#paper-dialog-actions class="layout-row layout-align-space-around"}}
    <a class="flex-30 paper-button md-button md-raised download-button" href="/api/export/drivers" download>download</a>
  {{/paper-dialog-actions}}
{{/paper-dialog}}

It dosn't trigger the download. When it's outside the dialog, it works fine.

@miguelcobain
Copy link
Collaborator

@BennyAlex
Copy link
Author

Anyway to avoid this?

@miguelcobain
Copy link
Collaborator

I honestly don't know why that event suppression is needed.

Git blame points to @DanChadwick. Do you have any idea of why that is needed?

@DanChadwick
Copy link
Contributor

@miguelcobain No memory of this as I've been on another project for a while, but isn't that needed so that the click outside the dialog only closes the dialog and isn't processed as a click. For example, you open a dialog and then click. Suppose the click happens to be on "delete all", but its dimmed by the backdrop. Or maybe I'm completely wrong.

@miguelcobain
Copy link
Collaborator

I see. We're just stopping the propagation, not preventing the default behavior. 🤔

@BennyAlex
Copy link
Author

As long as no fix exists, any idea what i could use instead of this download link?

@miguelcobain
Copy link
Collaborator

I know what's wrong and I know how to fix. For now, not using clickOutsideToClose mitigates the problem. I should be able to land a fix in a couple of hours.

@BennyAlex
Copy link
Author

I need it tomorrow, so would be really nice to get it soon

@miguelcobain
Copy link
Collaborator

@BennyAlex it is fixed on master

@BennyAlex
Copy link
Author

thank you. When will you release a new Version? Long time ago since the last one...

@miguelcobain
Copy link
Collaborator

v1.0.0-alpha.4 was released

@BennyAlex
Copy link
Author

Can you tell me please, how I can use your commit as an dependency in npm?

@miguelcobain
Copy link
Collaborator

@BennyAlex in your package.json you can have "ember-paper": "miguelcobain/ember-paper#some-commit-sha-or-tag-here.

But, like I said, I released alpha 4.

@BennyAlex
Copy link
Author

Thanks again. I already tried "ember-paper": "miguelcobain/ember-paper#some-commit-sha-or-tag-here." but it throws a'The Broccoli Plugin: [Funnel: AngularScssFunnel] failed with:'-error.
alpha 4 works fine.

@BennyAlex
Copy link
Author

@miguelcobain I have a select and now with alpha-4 I can't choose any items

@miguelcobain
Copy link
Collaborator

@BennyAlex that is expected. paper-menu, paper-select and paper-autocomplete aren't finished yet, as it is noted with the little warning sign on the docs.

You have two options:

  • you can use the existing paper-menu branch (run npm install --save-dev miguelcobain/ember-paper#paper-menu) and use the nearly finished versions of those components
  • use 0.2 version

I strongly advise to go with the first because:

  • your codebase will be much easier to update later. The api you use in that branch will be the same as when we release ember-paper v1
  • version 0.2 lacks many things and has some bugs

Also, you should join us at #e-paper on slack (link in the README). There are many kind people there willing to help. :)

@BennyAlex
Copy link
Author

@miguelcobain I will have a look. I know that they are wip, but on alpha-3 it worked, and alpha-4 it is really broken

@BennyAlex
Copy link
Author

BennyAlex commented Oct 7, 2016

When install npm install --save-dev miguelcobain/ember-paper#paper-menu, and run it, following error occurs:


Serving on http://localhost:4200/

modules/ember-paper/components/paper-autocomplete.js: line 65, col 12, 'self' is not defined.
modules/ember-paper/components/paper-autocomplete.js: line 69, col 25, 'self' is not defined.

2 errors

===== 1 JSHint Error

The Broccoli Plugin: [Funnel: AngularScssFunnel] failed with:
Error: Attempting to watch missing directory: C:\Users\bfranz\workspace\route-management\frontend\node_modules\ember-paper\node_modules\angular-material-sourc
e\src
    at EventEmitter.Watcher_addWatchDir [as addWatchDir] (C:\Users\bfranz\workspace\route-management\frontend\node_modules\broccoli-sane-watcher\index.js:90:1
1)
    at C:\Users\bfranz\workspace\route-management\frontend\node_modules\ember-cli-broccoli\lib\builder.js:95:35
    at tryCatch (C:\Users\bfranz\workspace\route-management\frontend\node_modules\rsvp\dist\rsvp.js:538:12)
    at invokeCallback (C:\Users\bfranz\workspace\route-management\frontend\node_modules\rsvp\dist\rsvp.js:553:13)
    at C:\Users\bfranz\workspace\route-management\frontend\node_modules\rsvp\dist\rsvp.js:628:16
    at flush (C:\Users\bfranz\workspace\route-management\frontend\node_modules\rsvp\dist\rsvp.js:2373:5)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)

The broccoli plugin was instantiated at:
    at Funnel.Plugin (C:\Users\bfranz\workspace\route-management\frontend\node_modules\broccoli-plugin\index.js:7:31)
    at new Funnel (C:\Users\bfranz\workspace\route-management\frontend\node_modules\broccoli-funnel\index.js:56:10)
    at CoreObject.module.exports.treeForStyles (C:\Users\bfranz\workspace\route-management\frontend\node_modules\ember-paper\index.js:127:28)
    at CoreObject.superWrapper [as treeForStyles] (C:\Users\bfranz\workspace\route-management\frontend\node_modules\core-object\lib\assign-properties.js:32:18
)
    at CoreObject._treeFor (C:\Users\bfranz\workspace\route-management\frontend\node_modules\ember-cli\lib\models\addon.js:371:33)
    at CoreObject.treeFor (C:\Users\bfranz\workspace\route-management\frontend\node_modules\ember-cli\lib\models\addon.js:339:21)
    at C:\Users\bfranz\workspace\route-management\frontend\node_modules\ember-cli\lib\broccoli\ember-app.js:498:20
    at Array.map (native)
    at EmberApp.addonTreesFor (C:\Users\bfranz\workspace\route-management\frontend\node_modules\ember-cli\lib\broccoli\ember-app.js:496:30)
    at EmberApp.styles (C:\Users\bfranz\workspace\route-management\frontend\node_modules\ember-cli\lib\broccoli\ember-app.js:1284:25)

@miguelcobain
Copy link
Collaborator

@BennyAlex I'm sorry, you need to run the blueprint.
So, this is the full procedure:

$ npm install --save-dev miguelcobain/ember-paper#paper-menu
$ ember g ember-paper

Ignore the jshint errors for now, please.

@BennyAlex
Copy link
Author

I just use power-select now, works fine. So I can stay on alpha-4, which is better because we are workin in a team and alpha-4 is a better dependency

openhouse pushed a commit to wowbot2/ember-paper that referenced this issue Oct 7, 2016
* commit '2cb9be5574a486175e48bc1a8da4186611f3ddbe':
  1.0.0-alpha.4
  update CHANGELOG
  allow inner dialog clicks to bubble. closes adopted-ember-addons#511
  add ember resolution
  update ember-cli and fastboot
  call super
  remove Ember. property access
  update ember-cli to 2.8.0
  make it glimmer 2 compatible
  WIP - remove other super calls
  Add super calls inside paper-input lifecycle hooks.
  update ember-css-transitions
  referencing the correct API (adopted-ember-addons#493)
  Match paper-sidenav demo width to [email protected] (adopted-ember-addons#482)
  Fix ripple artifact in Chrome 51 (adopted-ember-addons#475)
  update ember-css-transitions
  update CHANGELOG for adopted-ember-addons#466
  update CHANGELOG for alpha.3
  Added autoprefixer support for Safari >= 6 to use -webkit-flex (adopted-ember-addons#466)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants