ngx-cookieconsent icon indicating copy to clipboard operation
ngx-cookieconsent copied to clipboard

It does not slide underneath in mobile browser

Open lorenzonet opened this issue 4 years ago • 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

lorenzonet avatar Mar 23 '20 15:03 lorenzonet

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)

Waniusza avatar May 05 '20 20:05 Waniusza

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

casper5822 avatar Jan 13 '21 08:01 casper5822

same problem here. Any fix?

henning410 avatar Jul 07 '22 18:07 henning410

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-

henning410 avatar Jul 08 '22 09:07 henning410