Skip to content

Commit

Permalink
Overlay bug fixes (#479)
Browse files Browse the repository at this point in the history
Per this PR: yext/answers#1168, the hook "onSubmit" was renamed to "onConductSearch". There was also a bug that was always using the button's max-width (100%) rather than the default button width when no text was present.

TEST=manual

Test locally using a newly generated HH test site with the theme and v1.7 of the Answers SDK. Serve, conduct search via buttons and via autocomplete.
  • Loading branch information
alexisgrow authored Nov 17, 2020
1 parent d52163f commit 1643d5a
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion static/js/overlay/button-frame/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default class OverlayButtonJS {
const buttonSize = buttonEl.getBoundingClientRect();
OverlayButtonJS.notifyParentFrame(new IFrameMessage(ActionTypes.BUTTON_READY, {
height: buttonSize.height,
width: buttonSize.width
width: config.labelText ? buttonSize.width : AnimationStyling.DEFAULT_BUTTON_SIZE
}));
break;
case ActionTypes.COLLAPSE:
Expand Down
2 changes: 1 addition & 1 deletion templates/universal-standard/script/searchbar.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const overlayConfig = {
customHooks: {
onSubmit: function (query) {
onConductSearch: function (query) {
window.Overlay.grow();
},
onClearSearch: function () {
Expand Down
2 changes: 1 addition & 1 deletion templates/vertical-grid/script/searchbar.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const overlayConfig = {
customHooks: {
onSubmit: function (query) {
onConductSearch: function (query) {
window.Overlay.grow();
},
onClearSearch: function () {
Expand Down
2 changes: 1 addition & 1 deletion templates/vertical-map/script/searchbar.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const overlayConfig = {
customHooks: {
onSubmit: function (query) {
onConductSearch: function (query) {
window.Overlay.grow();
},
onClearSearch: function () {
Expand Down
2 changes: 1 addition & 1 deletion templates/vertical-standard/script/searchbar.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const overlayConfig = {
customHooks: {
onSubmit: function (query) {
onConductSearch: function (query) {
window.Overlay.grow();
},
onClearSearch: function () {
Expand Down

0 comments on commit 1643d5a

Please sign in to comment.