vue-a11y / vue-axe

Accessibility auditing for Vue.js applications.
https://axe.vue-a11y.com/
MIT License
187 stars 13 forks source link

Console cleared even when `clearConsoleOnUpdate: false` #28

Closed danielroe closed 4 years ago

danielroe commented 4 years ago

(Duplicate of https://github.com/vue-a11y/vue-axe/issues/26 - possible regression?)

When running vue-axe with the following options, the console is cleared on load and on subsequent updates.

Vue.use(VueAxe, {
  auto: true, // with or without this line
  clearConsoleOnUpdate: false,
})
ktquez commented 4 years ago

@danielroe Thank you for that.

I will do some tests and answer soon.

darrinmn9 commented 4 years ago

I'm facing the same problem.

ktquez commented 4 years ago

Which version are you using?

The demo is working as expected.

If it is with the most current version and the error is happening, could you reproduce it online?

darrinmn9 commented 4 years ago

I can repro it on the demo link.

  1. load the page, confirm you see output in the console
  2. click on the "about" link, notice the console is cleared and you see
    Console was cleared                  vue-axe.js:25630
ktquez commented 4 years ago

@darrinmn9 Clearing the console when changing routes is expected behavior.

https://github.com/vue-a11y/vue-axe/blob/master/src/index.js#L43


In this case, if there is a demand for such functionality, we can add another option of clearConsoleOnRouteChange

darrinmn9 commented 4 years ago

Ah ok, im not sure if that is the same issue @danielroe is experiencing as well.

In terms of adding another option, I think that naming it clearConsoleOnRouteChange is too specific. Some people just don't want any dependency clearing the console, especially during local development. so ideally there would be an option for "never clear the console"

danielroe commented 4 years ago

I would definitely want to disable clearing the console full stop as it clears lots of useful information I use in developing an app.

I initially filed this issue as on first load of a Nuxt app, the console is cleared. I will provide a repro.

darrinmn9 commented 4 years ago

@ktquez @danielroe I created a PR to fix this, by adding an option allowConsoleClears. It defaults to true in order to not be a breaking change. Would love feedback.

https://github.com/vue-a11y/vue-axe/pull/30

darrinmn9 commented 4 years ago

allowConsoleClears added in v2.4.0