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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add datalist to examples #3984

Merged
merged 7 commits into from
Sep 22, 2021
Merged

Add datalist to examples #3984

merged 7 commits into from
Sep 22, 2021

Conversation

petesfrench
Copy link
Contributor

@petesfrench petesfrench commented Sep 15, 2021

Done

  • Adds datalist to examples without any styling.

Fixes #2673

QA

  • Open demo
  • Choose your favorite ice cream

Check if PR is ready for release

If this PR contains Vanilla SCSS code changes, it should contain the following changes to make sure it's ready for the release:

  • PR should have one of the following labels to automatically categorise it in release notes:
    • Feature 馃巵, Breaking Change 馃挘, Bug 馃悰, Documentation 馃摑, Maintenance 馃敤.
  • Vanilla version in package.json should be updated relative to the most recent release, following semver convention:
    • if CSS class names are not changed it can be bugfix relesase (x.x.X)
    • if CSS class names are changed/added/removed it should be minor version (x.X.0)
    • see the wiki for more details
  • Any changes to component class names (new patterns, variants, removed or added features) should be listed on the what's new page.
  • Documentation side navigation should be updated with the relevant labels.

Screenshots

Screenshot from 2021-09-15 13-35-09

@petesfrench petesfrench added the Documentation 馃摑 Documentation changes or updates label Sep 15, 2021
@webteam-app
Copy link

Demo starting at https://vanilla-framework-3984.demos.haus

@bartaz
Copy link
Contributor

bartaz commented Sep 15, 2021

It seems it's only Chrome that adds this native arrow on hover/focus when list is available.

Screenshot 2021-09-15 at 13 43 39

Firefox doesn't do anything at all.
Screenshot 2021-09-15 at 13 44 04

So I think it is fine if we just hide it in Chrome as well.

Having a look through MDN and stack overflow it seems it is possible: https://stackoverflow.com/questions/20937475/remove-datalist-dropdown-arrow-in-chrome

input::-webkit-calendar-picker-indicator {
  opacity: 0;
}

I think we should add something like that, but probably limit it to inputs that have datalist defined:

input[list]::-webkit-calendar-picker-indicator {
  opacity: 0;
}

Also there doesn't seem to be any way to style the list itself. This is a native element similar to select or autocomplete and it can't be styled with CSS.

scss/_base_forms.scss Outdated Show resolved Hide resolved
@bartaz
Copy link
Contributor

bartaz commented Sep 15, 2021

@petesfrench Can you also add this example to "Forms" documentation page (/docs/base/forms.md)? After Select maybe (or somewhere around there, where different input types are shown).

@petesfrench
Copy link
Contributor Author

@bartaz Is the drop down supposed to span the length of the input? Similar to it does on a select?

@bartaz
Copy link
Contributor

bartaz commented Sep 16, 2021

@bartaz Is the drop down supposed to span the length of the input? Similar to it does on a select?

I don't think we can do anything about it, it is controlled by the browser and styles won't affect it.

@petesfrench petesfrench changed the title Add datalist to examples - WIP Add datalist to examples Sep 17, 2021
@bartaz
Copy link
Contributor

bartaz commented Sep 17, 2021

@petesfrench All looks good.

Overall I think this addition can be counted as a feature, so would be good to:

  • bump vanilla version accordingly
  • add this to "what's new page" table
  • update the labels in the side navigation (remove ones from prev. version, and add 'new' to Forms page)

@petesfrench petesfrench added Feature 馃巵 New feature or request and removed Documentation 馃摑 Documentation changes or updates labels Sep 17, 2021
templates/docs/whats-new.md Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@bartaz bartaz merged commit 3733460 into canonical:master Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add datalist component
3 participants