Coder Social home page Coder Social logo

Comments (21)

arno-le avatar arno-le commented on June 6, 2024 3

@marlon360 Workaround for now: call ng build --prod --build-optimizer=false.

from ngx-sortablejs.

Yqnn avatar Yqnn commented on June 6, 2024 2

SortableJS/Sortable#1242

from ngx-sortablejs.

Yqnn avatar Yqnn commented on June 6, 2024 2

@roeir Indeed you're right.
I'm pretty sure it was working in Angular 5, but I just did the test with Angular 6 and it doesn't work anymore.

Another solution would be to attach the value to this :
this.forRepaintDummy = target.offsetWidth;
Like that it's working fine.

from ngx-sortablejs.

smnbbrv avatar smnbbrv commented on June 6, 2024

Hi, just validated it on my projects and must admit the issue is present. For me the global animations do not work either.

Is this a 2.3.0 bug? Did ~2.2.0 have this problem?

from ngx-sortablejs.

Yqnn avatar Yqnn commented on June 6, 2024

Apparently it was there before, I had the same issue with 2.2.2 .

from ngx-sortablejs.

Yqnn avatar Yqnn commented on June 6, 2024

I found out what's wrong.
Actually it's a bug here :
https://github.com/RubaXa/Sortable/blob/master/Sortable.js

The line 891 is removed by the code optimizer.
I'm preparing a pull requet.

from ngx-sortablejs.

smnbbrv avatar smnbbrv commented on June 6, 2024

Wow, you are a superman!

from ngx-sortablejs.

marlon360 avatar marlon360 commented on June 6, 2024

Still not working.
https://github.com/RubaXa/Sortable/pull/1242#issuecomment-359206927

from ngx-sortablejs.

smnbbrv avatar smnbbrv commented on June 6, 2024

Although the pull request got merged, the original library hasn't been updated yet (see package.json last update). When something bigger than 1.7.0 comes it should be fixed

from ngx-sortablejs.

roeir avatar roeir commented on June 6, 2024

@smnbbrv build-optimizer will remove the dummy var, as variable that never read, so assignment a value will never lead to anything. Way that @Yqnn suggested, about target.getBoundingClientRect(), in my opinion, is more appropriate

from ngx-sortablejs.

Tre665 avatar Tre665 commented on June 6, 2024

Hi guys, we also run into this problems. Is there something that we could do as a consumer to workaround this bug?

from ngx-sortablejs.

marlon360 avatar marlon360 commented on June 6, 2024

The workaround by @ygerg works:

Workaround for now: call ng build --prod --build-optimizer=false.

from ngx-sortablejs.

Tre665 avatar Tre665 commented on June 6, 2024

@marlon360 Thanks for the tipp! I hoped that in the meantime there would be a way that have the build optimizer still activated. But I guess you can't have everything :-) I have to check how much the prod size increases. Thanks again!

from ngx-sortablejs.

smnbbrv avatar smnbbrv commented on June 6, 2024

Hi guys,

just checked the animation in angular@7 and it seems that the new uglifier they use (Terser) is not breaking animation anymore.

Could you confirm?

from ngx-sortablejs.

marlon360 avatar marlon360 commented on June 6, 2024

@smnbbrv I updated to Angular 7.0.1 and no luck. If I build without the flag --build-optimizer=false, the animations won't work.

from ngx-sortablejs.

cthrax avatar cthrax commented on June 6, 2024

@smnbbrv We're on the following version and still experiencing this issue:
angular: 7.2.6
angular-cli: 7.3.2
angular-sortablejs: 2.7.0
sortablejs: 1.8.3

from ngx-sortablejs.

smnbbrv avatar smnbbrv commented on June 6, 2024

Animation works as expected.

Just tried with latest angular@8, [email protected] and [email protected]

When you still experience the issue please open a new issue with detail description and a way to reproduce it.

from ngx-sortablejs.

Jeroen96 avatar Jeroen96 commented on June 6, 2024

Hi animations aren't working for me when running with the --prod flag.

Angular cli: 8.3.20
Angular: 8.2.0
Ngx-sortablejs: 3.1.3
Sortablejs: 1.10.1

from ngx-sortablejs.

smnbbrv avatar smnbbrv commented on June 6, 2024

@Jeroen96 could you provide a minimal example?

from ngx-sortablejs.

Jeroen96 avatar Jeroen96 commented on June 6, 2024

I can create a blanco project and see if the issue is there, but the main parts look like the following:

Edit: I've created a new project with the angular cli. Same issues here when running ng serve --prod, no animations. Downgrading to sortablejs 1.9.0 where u stated it worked, doesnt work also.

Angular: 8.2.14
Angular-cli: 8.3.20
Ngx-sortablejs: 3.1.3
sortablejs: 1.10.1

App.module

@NgModule({
  declarations: [
    AppComponent,
    TopbarComponent,
    NavComponent,
    NavItemComponent
  ],
  exports: [
    InlineSVGModule,
    TranslateModule
  ],
  imports: [
    // angular
    BrowserModule,
    BrowserAnimationsModule,
    HttpClientModule,
    TranslateModule.forRoot({
      loader: {
        provide: TranslateLoader,
        useFactory: HttpLoaderFactory,
        deps: [HttpClient]
      }
    }),
    ApiModule.forRoot({ rootUrl: '/api' }),
    SortablejsModule.forRoot({ animation: 150 }),

    // 3rd party
    KeycloakAngularModule,
    InlineSVGModule.forRoot(),

    // core, shared & data
    SharedModule,
    CoreModule,
    DataModule,

    // app
    AppRoutingModule

  ],

component html

<div class="form-group">
          <label for="inputSeed" translate>labels.confirm_your_secret_key</label>
          <div class="drop-zone" id="drop-zone" [sortablejs]="dropZoneData" [sortablejsOptions]="dropZoneOptions">
            <div class="drag-box" *ngFor="let item of dropZoneData">{{item}}</div>
          </div>
        </div>

        <div class="box-storage" [sortablejs]="shuffledListData" [sortablejsOptions]="{group: 'seed', sort: false}">
          <div class="drag-box" *ngFor="let item of shuffledListData">{{item}}</div>
        </div>

component.ts

 this.dropZoneOptions = {
      onSort: (event: any) => {
        this.validateMnemonic();
      },
      group: 'seed'
    };

Running angular via: ng serve --prod --host 0.0.0.0 --disable-host-check

from ngx-sortablejs.

daaa57150 avatar daaa57150 commented on June 6, 2024

Why is this issue closed ?
I have the same problem: no animation when using production config.
My versions:

Angular: 9.1.11  
Angular CLI: 9.1.10  
ngx-sortablejs: 3.1.4  
sortablejs: 1.10.2  

Forcing the old versions [email protected] and [email protected] like told by @smnbbrv makes it work, but I'm not sure this is the correct fix...

from ngx-sortablejs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.