@selfcommunity/react-ui 0.7.0-alpha.330 → 0.7.0-alpha.331

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.
@@ -64,7 +64,7 @@ function CommentObjectReply(inProps) {
64
64
  props: inProps,
65
65
  name: PREFIX
66
66
  });
67
- const { className, elevation = 0, autoFocus = false, onReply, onSave, onCancel, editable = true, text = '', WidgetProps = { variant: 'outlined' } } = props, rest = tslib_1.__rest(props, ["className", "elevation", "autoFocus", "onReply", "onSave", "onCancel", "editable", "text", "WidgetProps"]);
67
+ const { id = 'CommentObjectReply', className, elevation = 0, autoFocus = false, onReply, onSave, onCancel, editable = true, text = '', WidgetProps = { variant: 'outlined' } } = props, rest = tslib_1.__rest(props, ["id", "className", "elevation", "autoFocus", "onReply", "onSave", "onCancel", "editable", "text", "WidgetProps"]);
68
68
  // CONTEXT
69
69
  const scUserContext = (0, react_core_1.useSCUser)();
70
70
  // RETRIEVE OBJECTS
@@ -135,8 +135,7 @@ function CommentsFeedObject(inProps) {
135
135
  setTimeout(() => {
136
136
  const el = document.querySelector(`#comment_object_${comment.id}`);
137
137
  if (el) {
138
- const y = el.getBoundingClientRect().top + window.pageYOffset - window.innerHeight / 2;
139
- window.scrollTo({ top: y, behavior: 'smooth' });
138
+ el.scrollIntoView({ behavior: 'smooth', block: 'center', inline: 'center' });
140
139
  }
141
140
  }, 300);
142
141
  }
@@ -62,7 +62,7 @@ export default function CommentObjectReply(inProps) {
62
62
  props: inProps,
63
63
  name: PREFIX
64
64
  });
65
- const { className, elevation = 0, autoFocus = false, onReply, onSave, onCancel, editable = true, text = '', WidgetProps = { variant: 'outlined' } } = props, rest = __rest(props, ["className", "elevation", "autoFocus", "onReply", "onSave", "onCancel", "editable", "text", "WidgetProps"]);
65
+ const { id = 'CommentObjectReply', className, elevation = 0, autoFocus = false, onReply, onSave, onCancel, editable = true, text = '', WidgetProps = { variant: 'outlined' } } = props, rest = __rest(props, ["id", "className", "elevation", "autoFocus", "onReply", "onSave", "onCancel", "editable", "text", "WidgetProps"]);
66
66
  // CONTEXT
67
67
  const scUserContext = useSCUser();
68
68
  // RETRIEVE OBJECTS
@@ -133,8 +133,7 @@ export default function CommentsFeedObject(inProps) {
133
133
  setTimeout(() => {
134
134
  const el = document.querySelector(`#comment_object_${comment.id}`);
135
135
  if (el) {
136
- const y = el.getBoundingClientRect().top + window.pageYOffset - window.innerHeight / 2;
137
- window.scrollTo({ top: y, behavior: 'smooth' });
136
+ el.scrollIntoView({ behavior: 'smooth', block: 'center', inline: 'center' });
138
137
  }
139
138
  }, 300);
140
139
  }