「補完時の選択の残念な挙動」に挑戦

補完時の選択の残念な挙動に挑戦してみました。



無理っぽいです…orz

高さが分からないと、表示範囲が特定できないけど、
データが生成されないと画像の高さが分からないというジレンマ…


以下、強引に表示だけできるようにしてみました。

diff -r d92292ab219c ui.js
--- a/ui.js	Thu Feb 18 23:14:45 2010 +0900
+++ b/ui.js	Thu Feb 18 23:53:18 2010 +0900
@@ -2031,6 +2031,23 @@
             {
                 getCompletion(index).setAttribute("selected", "true");
                 //getCompletion(index).scrollIntoView(false);
+                let(height=container.clientHeight){
+                    if(height>0){
+                        let get_itemes=function(i,j){
+                            for(;i<j;++i)
+                                yield getCompletion(i);
+                        };
+                        height -= getCompletion(index).getBoundingClientRect().bottom;
+
+                        if(height < 0) for(let r in get_itemes(newOffset,index)){
+                            height += r.clientHeight;
+                            r.style.display = "none";
+                            if(height >= 0) break;
+                        }
+                        for(let r in get_itemes(index, endIndex))
+                            r.style.display = "";
+                    }
+                }
             }
 
             //if (index == 0)