Skip to content

use a tag instead of abbr tag for search-choice-close - #2726

Closed
koenpunt wants to merge 5 commits into
mainfrom
search-choice-close
Closed

koenpunt wants to merge 5 commits into
mainfrom
search-choice-close

Conversation

@koenpunt

Copy link
Copy Markdown
Contributor

fixes #495

@koenpunt

Copy link
Copy Markdown
Contributor Author

@mlettini do you have anything to say about this?

@mlettini

Copy link
Copy Markdown
  • +1 to not using the abbr tag for this... forget why it was done in the first place!
  • Now that we're using an <a>, I think we need to add more reset properties to .search-choice-close just to make sure that a page's base styles don't break it, something like: { margin:0; padding:0; border:0; }, though potentially other properties too...
  • The above is not a +1 to the JS which needs another dev to look at it 👌

Comment thread coffee/chosen.proto.coffee Outdated
@selected_item.down("span").insert { after: "<abbr class=\"search-choice-close\"></abbr>" } unless @selected_item.down("abbr")
@selected_item.addClassName("chosen-single-with-deselect")
unless @selected_item.down('.search-choice-close')
@selected_item.down('span').insert { after: '<a class="search-choice-close"></a>' }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as there is no href, this won't get a pointer cursor in a cross-browser way (and browsers not showing it are perfectly fine according to the spec)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 28-30 of sass/chosen.scss force a cursor to all links within .chosen-container, but I agree that no href is less semantic.

@stof stof Oct 17, 2016 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

proper semantic would probably be a <button type="button"> rather than a <a> btw.

@koenpunt

Copy link
Copy Markdown
Contributor Author

Updated per @stof's comment about using a button. Removed some duplicate CSS in the process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Do not use <abbr> tag

3 participants