Coder Social home page Coder Social logo

[Bug] 表格单元格输入值,光标没有失去焦点,点击外部的按钮导出表格数据,导出的数据没有当前输入的值 about univer HOT 8 CLOSED

yyyyffqqqq avatar yyyyffqqqq commented on May 28, 2024
[Bug] 表格单元格输入值,光标没有失去焦点,点击外部的按钮导出表格数据,导出的数据没有当前输入的值

from univer.

Comments (8)

iamyunsin avatar iamyunsin commented on May 28, 2024 1

@Dushusir 我觉得点击外部按钮或其它区域时不应该主动触发失焦,因为那样可能会导致我们在通过外部按钮做某些需要获取当前选区的功能时遇到困难。
我觉得这个场景,应该在用户点击“导出表格数据”按钮时,由开发人员编码调用Univer提供的API来失焦或存储当前用户正在输入的值,然后再执行导出的代码。

from univer.

jikkai avatar jikkai commented on May 28, 2024 1

@Dushusir 我觉得点击外部按钮或其它区域时不应该主动触发失焦,因为那样可能会导致我们在通过外部按钮做某些需要获取当前选区的功能时遇到困难。
我觉得这个场景,应该在用户点击“导出表格数据”按钮时,由开发人员编码调用Univer提供的API来失焦或存储当前用户正在输入的值,然后再执行导出的代码。

The defocusing here doesn't mean that the cell itself becomes unfocused, but rather that it exits the editing mode.
However, the user can still obtain the cell that is currently in focus.

from univer.

Dushusir avatar Dushusir commented on May 28, 2024

@Jocs 考虑如果用户点击到表格外部,是否需要失焦

from univer.

Issues-translate-bot avatar Issues-translate-bot commented on May 28, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@Jocs Consider whether the focus needs to be lost if the user clicks outside the table

from univer.

Issues-translate-bot avatar Issues-translate-bot commented on May 28, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@Dushusir I think out-of-focus is actively triggered when clicking an external button or other area, because that may cause us to encounter difficulties when doing certain functions that require obtaining the current selection through external buttons.
I think in this scenario, when the user clicks the "Export Table Data" button, the developer should code to call the API provided by Univer to defocus or store the value currently being entered by the user, and then execute the exported code.

from univer.

linfaithjuntong avatar linfaithjuntong commented on May 28, 2024

请教一下,导出功能怎么做,文档里面没有这个导出功能介绍

from univer.

Issues-translate-bot avatar Issues-translate-bot commented on May 28, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Please tell me how to use the export function. There is no introduction to the export function in the document.

from univer.

jikkai avatar jikkai commented on May 28, 2024

In order to deal with more complex scenarios, we don't intend to implement this feature internally.

Fortunately, your can implement this feature via the Facade API.

import { DeviceInputEventType } from '@univerjs/engine-render';
import { FUniver } from '@univerjs/facade';

const univerAPI = FUniver.newAPI(univer);

$btn.addEventListener('click', () => {
    univerAPI.executeCommand('sheet.operation.set-cell-edit-visible', {
        visible: false,
        _eventType: DeviceInputEventType.PointerUp,
    });
});

from univer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.