Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

selectionStyle.cellBgColor 设置透明度的问题 #2027

Closed
mzhang-eric opened this issue Jul 2, 2024 · 2 comments
Closed

selectionStyle.cellBgColor 设置透明度的问题 #2027

mzhang-eric opened this issue Jul 2, 2024 · 2 comments
Assignees

Comments

@mzhang-eric
Copy link

mzhang-eric commented Jul 2, 2024

场景描述:
ListTable设置单元格select和hover时整行高亮,期望配置后的效果类似 rowSelect,点击单元格可以选中整行,鼠标hover也是整行高亮。

配置项如下:

const option = {
    hover: {
      highlightMode: 'row',
    },
    select: {
      highlightMode: 'row',
    },
    theme: {
      bodyStyle: {
        borderColor: '#e6e7e9',
        hover: {
          cellBgColor: '#d3eef5',
          inlineRowBgColor: '#d3eef5',
        },
      },
      selectionStyle: {
        cellBgColor: 'rgba(0, 174, 199, 0.2)',
        cellBorderLineWidth: 1,
        cellBorderColor: '#e6e7e9',
        // inlineRowBgColor: '#86dbeb',
        inlineRowBgColor: 'rgba(0, 174, 199, 0.2)',
      },
    },
  };

由于selectionStyle.cellBgColor必须设置透明度,导致以下两个问题:

1.在整行选中时,期望选中的单元格不特异化显示(如下图),在这个需求前提下,整行的单元格背景色需要设置成同一种,由于 cellBgColor 要求设置透明度,要保持一致的话,只能将 inlineRowBgColor 也设置成与 cellBgColor 一样的带有透明度的颜色,而无法使用上述配置中 #86dbeb 这种十六进制格式,就会导致行的高亮样式无法使用设计指定的颜色

webwxgetmsgimg

2.同时,由于cellBgColor设置了透明度,因此在鼠标hover该行时,选中的单元格背景色会受到 bodyStyle.hover.cellBgColor的影响,出现颜色叠加的现象

因此,selectionStyle.cellBgColor 是否能兼容设置十六进制颜色?

@fangsmile fangsmile self-assigned this Jul 3, 2024
@mzhang-eric
Copy link
Author

这个问题简化一下,就是selectionStyle.cellBgColor 是否能兼容设置十六进制颜色,目前只能设置rgba格式的

windexport_1721881886194

@fangsmile
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants