Skip to content

Commit 21b47c5

Browse files
committed
fix: boxes positioning broke as they were not cleared when an element is clicked
1 parent 382b096 commit 21b47c5

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/LiveDevelopment/BrowserScripts/RemoteFunctions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ function RemoteFunctions(config = {}) {
4646
// events happen
4747
const allowedHandlerFns = [
4848
"dismiss", // when handler gets this event, it should dismiss all ui it renders in the live preview
49-
"createInfoBox",
5049
"createToolBox",
50+
"createInfoBox",
5151
"createMoreOptionsDropdown",
5252
// render an icon or html when the selected element toolbox appears in edit mode.
5353
"renderToolBoxItem",
@@ -688,7 +688,7 @@ function RemoteFunctions(config = {}) {
688688
* @param {Element} element - The DOM element to select
689689
*/
690690
function selectElement(element) {
691-
cleanupPreviousElementState();
691+
dismissUIAndCleanupState();
692692
// this should also be there when users are in highlight mode
693693
scrollElementToViewPort(element);
694694

src/extensionsIntegrated/phoenix-pro/browser-context/info-box.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ InfoBox.prototype = {
113113
if (this.body && this.body.parentNode && this.body.parentNode === window.document.body) {
114114
window.document.body.removeChild(this.body);
115115
this.body = null;
116+
SHARED_STATE._infoBox = null;
116117
}
117118
}
118119
};

src/extensionsIntegrated/phoenix-pro/main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ define(function (require, exports, module) {
1717
}
1818

1919
const HelperCode = require("text!./browser-context/helper.js");
20-
const InfoBoxCode = require("text!./browser-context/info-box.js");
2120
const ToolBoxCode = require("text!./browser-context/tool-box.js");
21+
const InfoBoxCode = require("text!./browser-context/info-box.js");
2222
const MoreOptionsDropdownCode = require("text!./browser-context/more-options-dropdown.js");
2323
const TextEditCode = require("text!./browser-context/text-edit.js");
2424
const HyperlinkEditorCode = require("text!./browser-context/hyperlink-editor.js");
@@ -27,8 +27,8 @@ define(function (require, exports, module) {
2727
const RulerLinesCode = require("text!./browser-context/ruler-lines.js");
2828
const DragAndDropCode = require("text!./browser-context/dragAndDrop.js");
2929
const HotCornersCode = require("text!./browser-context/hot-corners.js");
30-
const GenericToolsCode = require("text!./browser-context/generic-tools.js");
3130
const ToastMessageCode = require("text!./browser-context/toast-message.js");
31+
const GenericToolsCode = require("text!./browser-context/generic-tools.js");
3232

3333
function _addRemoteScripts() {
3434
// the ordering here is important
@@ -44,8 +44,8 @@ define(function (require, exports, module) {
4444

4545
// functions start here
4646
RemoteScriptProvider.addRemoteFunctionScript("HelperCode", HelperCode);
47-
RemoteScriptProvider.addRemoteFunctionScript("InfoBoxCode", InfoBoxCode);
4847
RemoteScriptProvider.addRemoteFunctionScript("ToolBoxCode", ToolBoxCode);
48+
RemoteScriptProvider.addRemoteFunctionScript("InfoBoxCode", InfoBoxCode);
4949
RemoteScriptProvider.addRemoteFunctionScript("MoreOptionsDropdownCode", MoreOptionsDropdownCode);
5050
RemoteScriptProvider.addRemoteFunctionScript("TextEditCode", TextEditCode);
5151
RemoteScriptProvider.addRemoteFunctionScript("HyperlinkEditorCode", HyperlinkEditorCode);

0 commit comments

Comments
 (0)