@bigbinary/neeto-editor 1.47.126 → 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.
package/dist/Editor.js CHANGED
@@ -2028,8 +2028,6 @@ var MentionList = /*#__PURE__*/function (_React$Component) {
2028
2028
  var _this2 = this;
2029
2029
  var selectedIndex = this.state.selectedIndex;
2030
2030
  var items = this.props.items;
2031
- var Menu = Dropdown.Menu,
2032
- MenuItem = Dropdown.MenuItem;
2033
2031
  if (isEmpty(items)) {
2034
2032
  return /*#__PURE__*/jsx("div", {
2035
2033
  className: "neeto-editor-mentions__wrapper",
@@ -2039,40 +2037,45 @@ var MentionList = /*#__PURE__*/function (_React$Component) {
2039
2037
  })
2040
2038
  });
2041
2039
  }
2040
+
2041
+ // Rendered with plain elements instead of neetoUI's Dropdown.Menu. That Menu
2042
+ // auto-focuses its <ul> on mount, which pulls focus out of the editor and
2043
+ // breaks mention typing/arrow navigation (the list is driven entirely by the
2044
+ // editor's keydown). neetoUI's class names are kept so the popup styling is
2045
+ // unchanged.
2042
2046
  return /*#__PURE__*/jsx("div", {
2043
2047
  className: "neeto-ui-dropdown__popup",
2044
- children: /*#__PURE__*/jsx(Menu, {
2045
- className: "neeto-editor-mentions__wrapper",
2048
+ children: /*#__PURE__*/jsx("ul", {
2049
+ className: "neeto-ui-dropdown__popup-menu neeto-editor-mentions__wrapper",
2046
2050
  "data-testid": "neeto-editor-mention-list",
2047
- ref: this.mentionRef
2048
- // Keep the list non-focusable so neetoUI's Menu can't auto-focus its
2049
- // <ul> and steal focus from the editor; mention keystrokes and arrow
2050
- // keys are handled through the editor's own keydown.
2051
- ,
2052
- tabIndex: null,
2051
+ ref: this.mentionRef,
2053
2052
  children: items.map(function (_ref2, index) {
2054
2053
  var key = _ref2.key,
2055
2054
  name = _ref2.name,
2056
2055
  imageUrl = _ref2.imageUrl;
2057
- return /*#__PURE__*/jsxs(MenuItem.Button, {
2058
- "data-testid": "neeto-editor-mention-list-".concat(name),
2059
- type: "button",
2060
- className: classnames("neeto-editor-mentions__item", {
2061
- active: index === selectedIndex
2062
- }),
2063
- onClick: function onClick() {
2064
- return _this2.selectItem(index);
2065
- },
2066
- children: [/*#__PURE__*/jsx(Avatar, {
2067
- size: "small",
2068
- user: {
2069
- name: name,
2070
- imageUrl: imageUrl
2071
- }
2072
- }), /*#__PURE__*/jsx(Typography, {
2073
- style: "body2",
2074
- children: name
2075
- })]
2056
+ return /*#__PURE__*/jsx("li", {
2057
+ className: "neeto-ui-dropdown__popup-menu-item",
2058
+ role: "menuitem",
2059
+ children: /*#__PURE__*/jsxs("button", {
2060
+ "data-testid": "neeto-editor-mention-list-".concat(name),
2061
+ type: "button",
2062
+ className: classnames("neeto-ui-dropdown__popup-menu-item-btn neeto-editor-mentions__item", {
2063
+ active: index === selectedIndex
2064
+ }),
2065
+ onClick: function onClick() {
2066
+ return _this2.selectItem(index);
2067
+ },
2068
+ children: [/*#__PURE__*/jsx(Avatar, {
2069
+ size: "small",
2070
+ user: {
2071
+ name: name,
2072
+ imageUrl: imageUrl
2073
+ }
2074
+ }), /*#__PURE__*/jsx(Typography, {
2075
+ style: "body2",
2076
+ children: name
2077
+ })]
2078
+ })
2076
2079
  }, key);
2077
2080
  })
2078
2081
  })