apache / netbeans

Apache NetBeans
https://netbeans.apache.org/
Apache License 2.0
2.62k stars 841 forks source link

The code completion popup overlay cannot display items correctly when user scroll up/down the list. #3820

Open rickqinj opened 2 years ago

rickqinj commented 2 years ago

Apache NetBeans version

Apache NetBeans 13

What happened

The code completion popup window may not function right when the window shows up near the bottom edge of the Netbeans IDE's window.

How to reproduce

This issue is really weird. We can reproduce it ONLY in a particular situation.

  1. Activate the Look and Feel - FlatLaf Light.

  2. Coding in Java.

  3. Make a statement close to the bottom edge of the Netbeans IDE's window. For example, the statement may look like the following:

    String str = new String();
    str.
  4. Move your caret to the line str. and behind the dot. Image 6

  5. Press ctrl+\ to call out the code completion popup window. Image 7

  6. Scroll back and forth the "Option list" by Arrow_DOWN or mouse scrolling wheel or dragging the scroll bar of the Option list. Then, you will see the Option list could be stuck and don't get refreshed anymore.

Note:

  1. If you switch the Look and Feel to the Windows one, everything will be fine.
  2. The issue only occurs when the first entry in the Option list has a JavaDoc. Everything goes fine If the first entry coming to the Option list doesn't have a JavaDoc(I mean, no need to popup the JavaDoc window).

Did this work correctly in an earlier version?

Apache NetBeans 12.6

Operating System

Win10 pro 64bit

JDK

Oracle JDK 11.0.8

Apache NetBeans packaging

Apache NetBeans provided installer

Anything else

No response

Are you willing to submit a pull request?

No

Code of Conduct

Yes

neilcsmith-net commented 2 years ago

Were you using the same look and feel when this worked on 12.6? Can you try with an up-to-date JDK? There seem to have been some text related bug fixes since 11.0.8 that might be a cause.

rickqinj commented 2 years ago

Were you using the same look and feel when this worked on 12.6? Can you try with an up-to-date JDK? There seem to have been some text related bug fixes since 11.0.8 that might be a cause.

Hi, I tried it again with the LAF Windows and found the problem's gone. It seems like the issue was caused by the new default LAF - FlatLaf light.

newk5 commented 2 years ago

This has also happened to me alot, it seems to be random, I still dont know what causes it, I'm not sure its related to the LAF but yea this has happened in previous versions too atleast since version 11. I haven't used versions 10 and 9.

rickqinj commented 2 years ago

This has also happened to me alot, it seems to be random, I still dont know what causes it, I'm not sure its related to the LAF but yea this has happened in previous versions too atleast since version 11. I haven't used versions 10 and 9.

I think NB11 hasn't had the new LAF - FlatLaf light yet at that time. Have you tried it with other LAFs on NB11?

newk5 commented 2 years ago

I'm not sure its related with the LAF, but I think I remember this happening in version 11. For me I was never able to reproduce it, it just happened randomly, so I'm not 100% sure

rickqinj commented 2 years ago

I'm not sure its related with the LAF, but I think I remember this happening in version 11. For me I was never able to reproduce it, it just happened randomly, so I'm not 100% sure

For me, this issue only happens when the code completion list needs to be re-positioned and the first item that appears in the list has a JavaDoc need to display. So, the conditions to reproduce are:

Chris2011 commented 2 years ago

I can reproduce it with JDK 14, Win 10, NB 13 and Dark Look and Feel. I did the exact same steps. I wanted to scroll by mouse wheel but nothing happend it seems so. If this is related to the LaF maybe @DevCharly can help here. Will check another LaF with the same steps later.