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

Why reset styles after animating in Angular? #25397

Open
Drovosek01 opened this issue Aug 8, 2018 · 1 comment
Open

Why reset styles after animating in Angular? #25397

Drovosek01 opened this issue Aug 8, 2018 · 1 comment
Labels
area: animations freq1: low P4 A relatively minor issue that is not relevant to core functions type: bug/fix
Milestone

Comments

@Drovosek01
Copy link

Drovosek01 commented Aug 8, 2018

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[ ] Feature request
[x] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:

Current behavior

The Input field appears and stretches during the animation time, and then the styles that were applied during the animation time are removed (the width and border of the input element become standard, not the ones I specified in the "style({})" object

Expected behavior

The input box will appear and stretch to 608 pixels wide and will remain in this position until I click on the closing cross.

Minimal reproduction of the problem with instructions

https://stackblitz.com/edit/angular-3ug5j7?file=app%2Fexample.component.ts

What is the motivation / use case for changing the behavior?

I animate the search bar using Angular animation and ngIf. After the input field appears, when its input animation ends, the applied styles are reset (the width becomes standard and the border disappears). Why is this happening and how to fix it?

Environment


Angular version: 6.0.0


Browser:
- [x] Chrome (desktop) version 68.0.3440.84
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: v8.11.3  
- Platform:  Windows 10 64bit

Others:

@ngbot ngbot bot added this to the needsTriage milestone Aug 8, 2018
@manklu
Copy link

manklu commented Aug 9, 2018

Have a look at the documentation: https://angular.io/guide/animations

Especially the difference between states and transitions.

@ngbot ngbot bot modified the milestones: needsTriage, Backlog Sep 27, 2018
@jelbourn jelbourn added P4 A relatively minor issue that is not relevant to core functions and removed severity2: inconvenient labels Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: animations freq1: low P4 A relatively minor issue that is not relevant to core functions type: bug/fix
Projects
None yet
Development

No branches or pull requests

5 participants