@bigbinary/neeto-editor 1.47.127 → 1.47.130

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2107,8 +2107,6 @@ var MentionList = /*#__PURE__*/function (_React$Component) {
2107
2107
  var _this2 = this;
2108
2108
  var selectedIndex = this.state.selectedIndex;
2109
2109
  var items = this.props.items;
2110
- var Menu = Dropdown__default.default.Menu,
2111
- MenuItem = Dropdown__default.default.MenuItem;
2112
2110
  if (ramda.isEmpty(items)) {
2113
2111
  return /*#__PURE__*/jsxRuntime.jsx("div", {
2114
2112
  className: "neeto-editor-mentions__wrapper",
@@ -2118,40 +2116,45 @@ var MentionList = /*#__PURE__*/function (_React$Component) {
2118
2116
  })
2119
2117
  });
2120
2118
  }
2119
+
2120
+ // Rendered with plain elements instead of neetoUI's Dropdown.Menu. That Menu
2121
+ // auto-focuses its <ul> on mount, which pulls focus out of the editor and
2122
+ // breaks mention typing/arrow navigation (the list is driven entirely by the
2123
+ // editor's keydown). neetoUI's class names are kept so the popup styling is
2124
+ // unchanged.
2121
2125
  return /*#__PURE__*/jsxRuntime.jsx("div", {
2122
2126
  className: "neeto-ui-dropdown__popup",
2123
- children: /*#__PURE__*/jsxRuntime.jsx(Menu, {
2124
- className: "neeto-editor-mentions__wrapper",
2127
+ children: /*#__PURE__*/jsxRuntime.jsx("ul", {
2128
+ className: "neeto-ui-dropdown__popup-menu neeto-editor-mentions__wrapper",
2125
2129
  "data-testid": "neeto-editor-mention-list",
2126
- ref: this.mentionRef
2127
- // Keep the list non-focusable so neetoUI's Menu can't auto-focus its
2128
- // <ul> and steal focus from the editor; mention keystrokes and arrow
2129
- // keys are handled through the editor's own keydown.
2130
- ,
2131
- tabIndex: null,
2130
+ ref: this.mentionRef,
2132
2131
  children: items.map(function (_ref2, index) {
2133
2132
  var key = _ref2.key,
2134
2133
  name = _ref2.name,
2135
2134
  imageUrl = _ref2.imageUrl;
2136
- return /*#__PURE__*/jsxRuntime.jsxs(MenuItem.Button, {
2137
- "data-testid": "neeto-editor-mention-list-".concat(name),
2138
- type: "button",
2139
- className: classnames__default.default("neeto-editor-mentions__item", {
2140
- active: index === selectedIndex
2141
- }),
2142
- onClick: function onClick() {
2143
- return _this2.selectItem(index);
2144
- },
2145
- children: [/*#__PURE__*/jsxRuntime.jsx(Avatar__default.default, {
2146
- size: "small",
2147
- user: {
2148
- name: name,
2149
- imageUrl: imageUrl
2150
- }
2151
- }), /*#__PURE__*/jsxRuntime.jsx(Typography__default.default, {
2152
- style: "body2",
2153
- children: name
2154
- })]
2135
+ return /*#__PURE__*/jsxRuntime.jsx("li", {
2136
+ className: "neeto-ui-dropdown__popup-menu-item",
2137
+ role: "menuitem",
2138
+ children: /*#__PURE__*/jsxRuntime.jsxs("button", {
2139
+ "data-testid": "neeto-editor-mention-list-".concat(name),
2140
+ type: "button",
2141
+ className: classnames__default.default("neeto-ui-dropdown__popup-menu-item-btn neeto-editor-mentions__item", {
2142
+ active: index === selectedIndex
2143
+ }),
2144
+ onClick: function onClick() {
2145
+ return _this2.selectItem(index);
2146
+ },
2147
+ children: [/*#__PURE__*/jsxRuntime.jsx(Avatar__default.default, {
2148
+ size: "small",
2149
+ user: {
2150
+ name: name,
2151
+ imageUrl: imageUrl
2152
+ }
2153
+ }), /*#__PURE__*/jsxRuntime.jsx(Typography__default.default, {
2154
+ style: "body2",
2155
+ children: name
2156
+ })]
2157
+ })
2155
2158
  }, key);
2156
2159
  })
2157
2160
  })