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

update/3329: Changed autocomplete menu "ul > li > button" to "div > button" #3343

Merged
merged 15 commits into from
Nov 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
829dfea
update/3329: Changed autocomplete menu "ul > li > button" to "div > b…
tiny-james Nov 6, 2017
3c6b8f9
update/3329: Updated selector to be more specific to fix tests
tiny-james Nov 6, 2017
570fbee
update/3329: Fix styling - images don't shrink, text has max-width
tiny-james Nov 7, 2017
73a6231
Merge branch 'master' into update/3329-autocomplete-aria-markup-impro…
tiny-james Nov 7, 2017
c229639
update/3329: specify profile picture size to avoid resizing after load
tiny-james Nov 7, 2017
fa85051
update/3329: ESC suppresses popup, CTRL+SPACE reshows; List count spo…
tiny-james Nov 7, 2017
7d8aedb
Merge branch 'master' into update/3329-autocomplete-aria-markup-impro…
tiny-james Nov 7, 2017
49413dc
Merge branch 'master' into update/3329-autocomplete-aria-markup-impro…
tiny-james Nov 9, 2017
334ed13
update/3329: Autocompleter matches after word boundaries or space
tiny-james Nov 9, 2017
5c2570c
Merge branch 'master' into update/3329-autocomplete-aria-markup-impro…
tiny-james Nov 10, 2017
45c3a55
update/3329: Fix the list staying suppressed when the cursor is moved
tiny-james Nov 10, 2017
0d0e8f2
Merge branch 'master' into update/3329-autocomplete-aria-markup-impro…
tiny-james Nov 13, 2017
b3325c1
update/3329: fixed withFocusOutside position in call order
tiny-james Nov 13, 2017
5976604
update/3329: Renamed classes to follow BEM style guide
tiny-james Nov 13, 2017
bdeff5a
update/3329: Bracketed test of turnary statement to improve readability
tiny-james Nov 13, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions blocks/autocompleters/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function blockAutocompleter( { onReplace } ) {
};

return {
className: 'blocks-block-autocomplete',
className: 'blocks-autocompleters__block',
triggerPrefix: '/',
getOptions,
allowContext,
Expand All @@ -99,9 +99,9 @@ export function userAutocompleter() {
return {
value: user,
label: [
<img key="avatar" alt="" src={ user.avatar_urls[ 24 ] } />,
<span key="name" className="name">{ user.name }</span>,
<span key="slug" className="slug">{ user.slug }</span>,
<img key="avatar" className="blocks-autocompleters__user-avatar" alt="" src={ user.avatar_urls[ 24 ] } />,
<span key="name" className="blocks-autocompleters__user-name">{ user.name }</span>,
<span key="slug" className="blocks-autocompleters__user-slug">{ user.slug }</span>,
],
keywords: [ user.slug, user.name ],
};
Expand All @@ -118,7 +118,7 @@ export function userAutocompleter() {
};

return {
className: 'blocks-user-autocomplete',
className: 'blocks-autocompleters__user',
triggerPrefix: '@',
getOptions,
allowNode,
Expand Down
41 changes: 32 additions & 9 deletions blocks/autocompleters/style.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,35 @@
.blocks-block-autocomplete .dashicon {
.blocks-autocompleters__block .dashicon {
margin-right: 8px;
}

.blocks-user-autocomplete img {
margin-right: 8px;
}

.blocks-user-autocomplete .slug {
margin-left: 8px;
color: $dark-gray-100;
}
.blocks-autocompleters__user {
.blocks-autocompleters__user-avatar {
Copy link
Member

Choose a reason for hiding this comment

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

One of the benefits of using a BEM convention is that it eliminates the need for nesting in many cases, so this could be moved to a top-level style definition.

margin-right: 8px;
flex-grow: 0;
flex-shrink: 0;
max-width: none; // we must override the gutenberg default of 100%
width: 24px; // avoid jarring resize by seting the size upfront
height: 24px;
}
.blocks-autocompleters__user-name {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
max-width: 200px;
flex-shrink: 0;
flex-grow: 1;
}
.blocks-autocompleters__user-slug {
margin-left: 8px;
color: $dark-gray-100;
white-space: nowrap;
text-overflow: ellipsis;
overflow: none;
max-width: 100px;
flex-grow: 0;
flex-shrink: 0;
}
&:hover .blocks-autocompleters__user-slug {
color: $blue-medium-300;
}
}
Loading