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

Paginator: options list visually inconsistent for legacy and standard appearance #13907

Open
ghost opened this issue Oct 31, 2018 · 6 comments · Fixed by #14607
Open

Paginator: options list visually inconsistent for legacy and standard appearance #13907

ghost opened this issue Oct 31, 2018 · 6 comments · Fixed by #14607
Labels
area: material/paginator P4 A relatively minor issue that is not relevant to core functions

Comments

@ghost
Copy link

ghost commented Oct 31, 2018

Bug, feature request, or proposal:

When defining globally the appearance of the app form-fields as standard (via MatFormFieldDefaultOptions), the paginator options list value is not vertically aligned with its arrow.
When using legacy, (visually) everything works as expected.
On a regular mat-form-field, this inconsistency isn't as noticeable, probably because the font size is larger than the one used on the paginator.

What is the expected behavior?

Paginator options (select element) should have its value aligned with the arrow, when using standard appearance.

What is the current behavior?

Paginator options' (select element) value is not vertically aligned with the arrow.

What are the steps to reproduce?

https://stackblitz.com/edit/angular-cqtqvd-zwpq9y?file=material-module.ts
On the material-module.ts file, go to line 48 and switch the property value between 'legacy' and 'standard'.

What is the use-case or motivation for changing an existing behavior?

Visual inconsistency when using the 'standard' appearance.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Only noticed on Angular 7 and Material 7.0.2, but this could probably affect previous versions.

Is there anything else we should know?

--

@ghost ghost changed the title Paginator: options list visually inconsistent with legacy and standard appearance Paginator: options list visually inconsistent for legacy and standard appearance Oct 31, 2018
@ghost
Copy link
Author

ghost commented Nov 12, 2018

I've updated the StackBlitz with an additional example.
The mat-select now allows a null option. Switch back and forth between one of the valid options and the first one (null), and you'll see the arrow moving up and down, when using the global standard appearance value.

@ghost ghost closed this as completed Nov 12, 2018
@ghost ghost reopened this Nov 12, 2018
@ghost
Copy link
Author

ghost commented Nov 12, 2018

(Sorry, closed the ticket by mistake)

@josephperrott josephperrott added the P4 A relatively minor issue that is not relevant to core functions label Nov 26, 2018
@crisbeto crisbeto self-assigned this Dec 21, 2018
crisbeto added a commit to crisbeto/material2 that referenced this issue Dec 21, 2018
Currently we move the arrow for a `mat-select` inside a form field up if it has a value, in order to align it in the middle of the field, however doing so when there is no label makes it look off-center. This is visible when using the `standard` appearance inside a `mat-paginator`. These changes only shift the arrow if there's a label.

Fixes angular#13907.
mmalerba pushed a commit that referenced this issue Jan 4, 2019
Currently we move the arrow for a `mat-select` inside a form field up if it has a value, in order to align it in the middle of the field, however doing so when there is no label makes it look off-center. This is visible when using the `standard` appearance inside a `mat-paginator`. These changes only shift the arrow if there's a label.

Fixes #13907.
josephperrott pushed a commit to josephperrott/components that referenced this issue Jan 14, 2019
Currently we move the arrow for a `mat-select` inside a form field up if it has a value, in order to align it in the middle of the field, however doing so when there is no label makes it look off-center. This is visible when using the `standard` appearance inside a `mat-paginator`. These changes only shift the arrow if there's a label.

Fixes angular#13907.
@ghost
Copy link
Author

ghost commented Jan 19, 2019

@crisbeto, @mmalerba and @josephperrott :

I'm not sure if I should open a new issue for this (because they might be related), but I'll share it here and await for further instructions.

I was just testing the latest version (7.2.1) and I noticed that if I set global appearance options for form fields (via MatFormFieldDefaultOptions), there are still visual inconsistencies, concerning its vertical alignment.

'legacy' appearance: everything is OK
'standard' appearance: page size options are below the vertical center line
'fill' appearance: page size options arrow is too high (since this select element will never have a label)
'outline' appearance: previous/next arrows are below the vertical center line

Please check the following link, and play with the options on material.module.ts, line 49
https://stackblitz.com/edit/angular-yakttk?file=material-module.ts

@mmalerba
Copy link
Contributor

When the spec originally came out, it showed that the inputted text should be a little below center for both the fill and outline appearance. However, the spec has since changed so that the outline appearance appears to be always centered and the fill appearance is centered when there is no label. Updating to match the spec is tricky because of the team's policy of syncing all changes into google's codebase as soon as they're merged on Github. This particular change will cause a huge number of screenshot test failures (many expected, and some unexpected due to use of CSS overrides) that the team will need to go through and resolve. #14171 is being used to track updating form-field to match the latest version of the spec.

@andrewseguin in the meantime maybe paginator should just add some CSS overrides? It does look pretty bad. Should it also have an option to set the appearance of the internal form-field?

@andrewseguin andrewseguin reopened this Jan 22, 2019
@andrewseguin
Copy link
Contributor

Will keep this issue open so we can track the progress on this. We should have good visuals on each type of form field

@mmalerba mmalerba removed the has pr label Jan 22, 2019
@flensrocker
Copy link

Should it also have an option to set the appearance of the internal form-field?

That would be fine - and maybe an option to place the label inside the form-field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: material/paginator P4 A relatively minor issue that is not relevant to core functions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants