• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

P: SDK: Windows edit field truncates multi-line pasted text

LEGEND ,
Oct 06, 2022 Oct 06, 2022

Copy link to clipboard

Copied

On Windows, when you paste multi-line text into an osFactory:edit_field with height_in_lines = 1, all but the first line is discarded. But this doesn't happen when you paste more than two lines into an edit field with height_in_lines = 2 -- all the lines are preserved.  Nor does the bad behavior occur on Mac.  The Windows behavior of height_in_lines = 1 is inconsistent with height_in_lines = 2 and with Mac height_in_lines = 1.

 

This bug affects my Any Filter plugin's user interface -- it's important for users to be able to paste in multiple lines of text into an edit_field that for UI design purposes should otherwise be one line high:

johnrellis_0-1665116440142.png

 

The script below illustrates the problem.  I've attached screen recordings of running it on Windows and Mac.

 

 

 

local LrBinding = import "LrBinding"
local LrDialogs = import "LrDialogs"
local LrFunctionContext = import "LrFunctionContext"
local LrView = import "LrView"

local bind = LrView.bind
local f = LrView.osFactory()

LrFunctionContext.callWithContext ("", function (context)
    local prop = LrBinding.makePropertyTable (context)
    local controls = f:column {bind_to_object = prop,
        f:edit_field {height_in_lines = 1, width_in_chars = 10,
            immediate = true, value = bind "text1"},
        f:static_text {height_in_lines = 5, width_in_chars = 10,
            title = bind "text1"},
        f:edit_field {height_in_lines = 2, width_in_chars = 10,
            immediate = true, value = bind "text2"},
        f:static_text {height_in_lines = 5, width_in_chars = 10,
            title = bind "text2"}}

    local result = LrDialogs.presentModalDialog {title = "edit_field bug", 
        contents = controls}
    end)

 

 

 

Bug Fixed
TOPICS
macOS , SDK , Windows

Views

522

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Pinned Replies

Adobe Employee , Oct 07, 2022 Oct 07, 2022

Update Status for Bug

Status Investigating

Votes

Translate

Translate
Adobe Employee , Aug 16, 2023 Aug 16, 2023

Greetings all,

 

Updates for the Adobe Photography Products have been released.  The August 2023 updates contain a fix for this issue. 

If you do not see the update in your Creative Cloud Application, you can refresh it by hitting [Ctrl/Cmd]+[Alt/Opt]+[ R ].

Note: It may take up to 24 hours for your update to be available in your Creative Cloud app.

 

Thank you for your patience.

Status Fixed

Votes

Translate

Translate
7 Comments
Adobe Employee ,
Oct 07, 2022 Oct 07, 2022

Copy link to clipboard

Copied

Update Status for Bug

Rikk Flohr - Customer Advocacy: Adobe Photography Products
Status Investigating

Votes

Translate

Translate

Report

Report
Adobe Employee ,
Jun 08, 2023 Jun 08, 2023

Copy link to clipboard

Copied

@johnrellis 
The team has asked if you can verify this workaround:

 

"A workaround is to have the below values for the edit_field. use_RTF will make the edit_field accept multiline text, and resize_to_fit_text_height will prevent the edit_field from expanding.

use_RTF = true, resize_to_fit_text_height = false"

Rikk Flohr - Customer Advocacy: Adobe Photography Products

Votes

Translate

Translate

Report

Report
LEGEND ,
Jun 08, 2023 Jun 08, 2023

Copy link to clipboard

Copied

That works, thanks much.

Votes

Translate

Translate

Report

Report
LEGEND ,
Jun 08, 2023 Jun 08, 2023

Copy link to clipboard

Copied

[This post contains formatting and embedded images that don't appear in email. View the post in your Web browser.]

 

The workaround works on Win, but on Mac (where the bug doesn't occur), it stores rich-text-formatted code in the bound value of the edit field, e.g.

 

johnrellis_0-1686243904966.png

 

I don't have access to any Lua code that parses RTF, but this modified workaround works just fine:

 

use_RTF = WIN_ENV, resize_to_fit_text_height = false

 

Votes

Translate

Translate

Report

Report
Adobe Employee ,
Jun 08, 2023 Jun 08, 2023

Copy link to clipboard

Copied

I will pass that back to the team.

Rikk Flohr - Customer Advocacy: Adobe Photography Products

Votes

Translate

Translate

Report

Report
Adobe Employee ,
Aug 16, 2023 Aug 16, 2023

Copy link to clipboard

Copied

Greetings all,

 

Updates for the Adobe Photography Products have been released.  The August 2023 updates contain a fix for this issue. 

If you do not see the update in your Creative Cloud Application, you can refresh it by hitting [Ctrl/Cmd]+[Alt/Opt]+[ R ].

Note: It may take up to 24 hours for your update to be available in your Creative Cloud app.

 

Thank you for your patience.

Rikk Flohr - Customer Advocacy: Adobe Photography Products
Status Fixed

Votes

Translate

Translate

Report

Report
LEGEND ,
Aug 17, 2023 Aug 17, 2023

Copy link to clipboard

Copied

LATEST

I confirmed that the original test script now runs correctly on both Win and Mac, thanks much.

Votes

Translate

Translate

Report

Report