tinesoft/ngx-cookieconsent

It does not slide underneath in mobile browser

lorenzonet opened this issue · 4 comments

Bug Report or Feature Request (mark with an x)

- [X ] bug report -> please search issues before submitting
- [ ] feature request

CookieConsent and Library Versions?

- cookieconsent version: 3.1.1
- ngx-cookieconsent version: 2.2.3

OS Version?

Windows 10

Angular, Node and al Versions?

Angular CLI: 8.3.8
Node: 12.13.0
OS: win32 x64
Angular: 8.2.10
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package Version

@angular-devkit/architect 0.803.8
@angular-devkit/build-angular 0.803.8
@angular-devkit/build-optimizer 0.803.8
@angular-devkit/build-webpack 0.803.8
@angular-devkit/core 8.3.8
@angular-devkit/schematics 8.3.8
@angular/cdk 8.2.3
@angular/cli 8.3.8
@angular/material 8.2.3
@angular/material-moment-adapter 8.2.3
@ngtools/webpack 8.3.8
@schematics/angular 8.3.8
@schematics/update 0.803.8
rxjs 6.5.3
typescript 3.5.3
webpack 4.39.2

Repro steps

run the application in mobile

The log given by the failure

cookie

Desired functionality

the box should slide underneath

Mention any other details that might be useful

It does not always happen

Had same annoying issue.

Solved by hiding it once accepted

Added below code in main component

   this.statusChangeSubscription = this.ccService.statusChange$.subscribe(
      (event: NgcStatusChangeEvent) => {
        if (event.status === 'allow') {
          this.cookieService.set(IS_COOKIE_ALLOWED, 'true');
          this.ccService.destroy();
        } else {
          this.cookieService.delete(IS_COOKIE_ALLOWED);
        }
      });
    let isCookieAllowed = this.cookieService.get(IS_COOKIE_ALLOWED);
    if (isCookieAllowed == 'true') {
      this.ccService.destroy();
    }

Note:
there is cookieService imported (ngx-cookie-service in our project)
there is const IS_COOKIE_ALLOWED: string defined whenever you want (defined and exported in cookie.conf.ts in our project)

We have the same problem, any update on this problem?

same problem here. Any fix?

In your app.module.ts you can use in the cookieConfig as type: info.
This makes the cookie banner dissappear when clicking the button. Not sure if it is what you need, but for me it solves the problem-