溢出滚动后保持绝对位置

我正在尝试将div保持在绝对位置(在右下角)。问题在于,当溢出时,滚动使绝对位置随父对象移动,而不是保持在原位置。

There are a lot of other questions like this, but this one is limited due to the use of the Material UI React framework.

我有相对位置的父母:

const MUIPaper = withStyles({
  root: {
    position: "relative",
    overflow: "auto"
  }
})(Paper);

和绝对的孩子:

const MUIButton = withStyles(theme => ({
  root: {
    position: "absolute",
    bottom: "1%",
    right: "1%"
  }
}))(Button);

这是行为(gif)的示例:

example

And you can try it yourself here. I saw some questions similar to this, but from ~2012 that said that it wasn't possible. Is this still the case or is there a way around this without using a fixed position?

评论